`vite-node` server HMR is broken
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v16.15.0
- Nuxt Version:
3.0.0-rc.6-27651720.5dc864d
- Package Manager:
yarn@1.22.19
- Builder:
vite
- User Config:
experimental
- Runtime Modules:
-
- Build Modules:
-
Reproduction
(on Windows, Linux, Docker (Linux) or WSL2 environment)
- Create new project with
npx nuxi init
(swit - Enable vite-node with `experimental
- Run dev server with
npm run dev
- Write simple
app.vue
such as<template><div>Hello world!</div></template>
- Open http://localhost:3000
- Edit
app.vue
- Reload
Describe the bug
Client is updated with HMR and subsequent reloads but server is not. Causing hydration error.
It might be related to the issue https://github.com/nuxt/framework/issues/2047 since now client HMR on Linux works and Server not (in current nuxt, it is otherwise). But also trying CHOKIDAR_USEPOLLING=1 I still have same issues.
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Troubleshooting - Vite
If you are running Vite with WSL2, Vite cannot watch file changes in some conditions. See server.watch option. A full reload happens instead...
Read more >node.js - Vite Hot Reload not working instead its reloading ...
i just migrated my CRA to vite successfully using the link https://dev.to/nilanth/use-vite-for-react-apps-instead-of-cra-3pkg , but whenever ...
Read more >Explore Hot Module Reloading integration of Vite with ...
HMR works as follows: A Node server serves the initial HTML page and initial versions of the JS/CSS/Vue files; The initial HTML page...
Read more >Hot Module Replacement - webpack
All we need to do is update our webpack-dev-server configuration, and use webpack's built-in HMR plugin. We'll also remove the entry point for...
Read more >Vite JS - Created to perform - collective:mind | DEV
It is packet with blazingly fast HMR and Rollup bundler for highly optimized static ... Vite's default types are for its Node.js API....
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
I can no longer reproduce it on rc.8. Seems an underlying library fixed the root cause!
@antfu Yes i could constantly reproduce on Windows (Windows 11 on PC + Parallers on M2 arm64) and Randomly on Linux (WSL). Will share a screen cast of issue. It is not directly fault of vite-node BTW but when we enable vite-node, since server watcher happens first, client watcher gets broken eventually.