Comments (2)
After a lot of trial and error, I have figured out where the issue is:
Nuxt's HMR is getting blocked when, in the custom vite plugin's "config" hook, either the original config object (after mutating it) or a mergedConfig is returned. Vite docs seems to support this return in the config hook.
This HMR break is specific to Nuxt, as HMR is not blocked in a plain Vue project with the same custom vite plugin .
This breaks Nuxt's HMR (returns a merged config)
And after some very long timeout (couple of minutes), this gets logged
This doesn't break HMR (avoids mergeConfig and directly mutates the config)
I have updated my Vite plugin to directly mutate instead returning a config using mergeConfig vite utility. The above is just an example, I do make few other config updates, hence used mergeConfig.
Even though this is solved at my end, why Nuxt's HMR is blocked when using mergeConfig utility and returning a merged config is still a mystery, unless Im not supposed to do this way.
Maintainers, please feel free to close this if you see no action on this issue. Thanks for looking into this.
from cli.
Updated reproduction to latest (3.13.0) using npx nuxi upgrade --force, and removed vue & vue-router from package.json as they not required to be added explicitly anymore. HMR works nicely 😃 !
Issue doesn't seem to reoccur anymore. Thanks @pi0 @danielroe.
from cli.
Related Issues (20)
- --bun uses different dependencies HOT 1
- Nuxi v3.12.0 constant pinging to localhost and failing HOT 7
- 3.12.0 Unable to set Vite HMR protocol
- npx nuxi@latest init <project-name> ERROR Invalid URL HOT 1
- Bug when installing modules HOT 1
- Using `nuxi --dotenv .env.staging` not working as expected inside NX monorepo
- drop legacy `rootDir` arg HOT 3
- Cannot override the registry when running `nuxi module add xxx` HOT 3
- nuxi always using default npm registry HOT 7
- ERROR Error: Failed to installing nuxt : Invalid URL HOT 3
- `nuxi module add` always install module as dependcies, even it should be `devDependencies` HOT 4
- `nuxi typecheck` does not works with alias imports (server) HOT 2
- `Nuxi init -t` 404s on `nuxt.json` HOT 3
- nuxt server Error HOT 1
- Stop console clearing
- Make nuxi prepare run with NODE_ENV set to "development" by default
- Type-checking with Bun
- `nuxi add` and `nuxi module add` HOT 2
- feat(upgrade): implement `to` argument for precise version control HOT 1
- [dev] x-forwared-proto should be passed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.