vite-node --watch
duplicates import.meta.hot.data
self-accepting module
#6823
Labels
vite-node --watch
duplicates import.meta.hot.data
self-accepting module
#6823
Describe the bug
For a self-accepting module, saving an unused
html
file in the same directory reloads the module, but doesn't preserve itsimport.meta.hot.data
.Triggering a hot update afterwards (by saving a dependency module) leads to the module being reloaded and
accept()
ed twice with differentimport.meta.hot.data
.Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-78iwey
Running
vite-node -c ./src/vite.config.js --watch ./src/index.mjs
prints:After changing
inner.mjs
, we can see thatindex.mjs
is reloaded, andimport.meta.hot.data
is preserved:But if we now change
unused.html
,index.mjs
is reloaded as if for the first time:If now we change
inner.mjs
again, we see both modules are reloaded andimport.meta.hot.accept()
runs for both:Full output:
System Info
npx envinfo --system --npmPackages '{vitest,@vitest/*,vite,@vitejs/*,vite-node}' --binaries --browsers
Output:
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: