question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate loading of the same resource on startup with Vite 2.9 beta1+

See original GitHub issue

Describe the bug

On the first page load in Chrome, after removing node_modules/.vite I see only a blank page. The reason is

Uncaught (in promise) DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "dom-module" has already been used with this registry

which in turn originates in that a JS file is loaded twice with different ?v= parameters image

It is a timing issue because if I open the Chrome inspector then the issue disappears and the vaadin.js file is still loaded twice but with the same ?v= parameter.

With 2.9.0.beta0 I do not see this problem

Reproduction

Cannot make a simple app. @patak-dev has access to the application where it can be reproduced

System Info

System:
    OS: macOS 12.2.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 2.24 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.6.0 - ~/.nvm/versions/node/v17.6.0/bin/node
    npm: 8.5.1 - ~/.nvm/versions/node/v17.6.0/bin/npm
  Browsers:
    Chrome: 99.0.4844.51
    Firefox: 98.0
    Safari: 15.3
  npmPackages:
    vite: v2.9.0-beta.1 => 2.9.0-beta.1

Used Package Manager

npm

Logs

No response

Validations

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
Artur-commented, Mar 17, 2022

Nice! I will test once there is a beta 4

1reaction
vursencommented, Mar 17, 2022

I can confirm that the error is still there even with beta.3. Make sure you don’t open DevTools with the enabled Disable cache option when running the app as otherwise, the issue doesn’t tend to reproduce.

Considering the latter note, it seems to have something to do with the browser cache. The page gets stuck because of the duplicate of the vaadin.js dependency where the difference is only in the version parameter, but once I enable Disable cache in DevTools and reload the page, the page loads correctly. It is just a guess, but maybe it is the ETag header not getting updated after the deps optimization is complete.

Here is the recording:

https://user-images.githubusercontent.com/5039436/158601475-63ec5512-64f7-4dad-8737-0d8efad39754.mov

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vite | Next Generation Frontend Tooling
Vite. Next Generation Frontend Tooling. Get ready for a development environment that ... Vite is free and open source, made possible by wonderful...
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
Compare Packages Between Distributions - DistroWatch.com
This page enables us to quickly perform a side-by-side comparison of the packages available in two different distributions, or in two different versions...
Read more >
Search Results - CVE
4.14 contains a path traversal vulnerability which allows attackers to access restricted files and directories via uploading a crafted JAR file into the ......
Read more >
Laravel Vite Issue - Laracasts
vite v2.9.13 dev server running at: Local: http://localhost:5173/ Network: ... Blocked: The Same Origin Policy disallows reading the remote resource at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found