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
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.
This is because when building, Vite will set process.env.NODE_ENV to production which wouldn't work in dev mode and Vue HMR fails as they HMR code isn't injected correctly. A solution is to run the build in dev mode too, passing mode: 'development' to the build config.
This issue isn't really easy to solve by Vite as process.env.NODE_ENV is a shared variable used by plugins too. So if you need to run the build in production, you can spawn another process to run it.
This is because when building, Vite will set process.env.NODE_ENV to production which wouldn't work in dev mode and Vue HMR fails as they HMR code isn't injected correctly. A solution is to run the build in dev mode too, passing mode: 'development' to the build config.
This issue isn't really easy to solve by Vite as process.env.NODE_ENV is a shared variable used by plugins too. So if you need to run the build in production, you can spawn another process to run it.
Describe the bug
When I run the local server with "build" and "createServer" at the same time, the page can't perform HMR.
Reproduction
https://stackblitz.com/edit/node-nuu1gt?file=build%2Fdev-runner.js,src%2FApp.vue
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: