Duplicate loading of the same resource on startup with Vite 2.9 beta1+
See original GitHub issueDescribe 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
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
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (12 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nice! I will test once there is a beta 4
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 enableDisable cache
in DevTools and reload the page, the page loads correctly. It is just a guess, but maybe it is theETag
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