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 then npm run dev
- Open devtools
- Do any change in
App.tsx, i.e. change the content of h1 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
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.tsxfile you will get an error in the devtoolsNow 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
npm installand thennpm run devApp.tsx, i.e. change the content ofh1tagSystem Info
Used Package Manager
npm
Logs
No response
Validations