Open
Description
Describe the bug
There is a regression in Vite 6.2.2 related to Hot Module Replacement
In the repro if you run the dev server and make any update in App.tsx
file you will get an error in the devtools
Now your app and dev server is broken and you need to kill and restart it to make the app working again.
If you rollback to Vite 6.2.1, then HMR is working fine.
Reproduction
https://github.com/Mikilll94/vite-hmr-issue
Steps to reproduce
- Download repro project.
- Run
npm install
and thennpm run dev
- Open devtools
- Do any change in
App.tsx
, i.e. change the content ofh1
tag - As you can see the app is broken and there is an error in devtools.
System Info
This command is not working for me on Windows but it does matter because I have provided a clear reproduction.
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.