You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We write some library with .vue components and utils (for this components and other). This utils can have some state, and methods for change it(keys is symbols). In real project with vite(Nuxt3 setup) we found duplication of imported modules(by console.log)
This problem from vite or vue-plugin, can't say for sure, sometimes module load 2 times, sometimes 3, and this critical because we use symbols
In repro duplicates is /node_modules/.vite/deps/chunk-VQ4VIJMT.js?v=3a551489 and /node_modules/shared/shared.js
.vue file is initiator of shared.js, and simple .js is initiator of chunk-VQ4VIJMT.js?v=3a551489 file
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 vuejs/core instead.
I think this is a duplicate of #3910. The workaround for now is to add that library, e.g. vite-library-bug-double-load, to optimizeDeps.exclude, and if there's any CJS deps used by that library, it needs to be re-added to optimizeDeps.include, e.g. vite-library-bug-double-load > cjs-dep.
Describe the bug
We write some library with
.vue
components and utils (for this components and other). This utils can have some state, and methods for change it(keys is symbols). In real project with vite(Nuxt3 setup) we found duplication of imported modules(by console.log)This problem from
vite
or vue-plugin, can't say for sure, sometimes module load 2 times, sometimes 3, and this critical because we use symbolsProblem is similar to #7323
In repro duplicates is
/node_modules/.vite/deps/chunk-VQ4VIJMT.js?v=3a551489
and/node_modules/shared/shared.js
.vue file is initiator of
shared.js
, and simple.js
is initiator ofchunk-VQ4VIJMT.js?v=3a551489
fileReproduction
https://github.com/Kolobok12309/vitejs-double-file-load
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: