Skip to content

HMR crashes in Vite 6.2.2 #19690

Open
Open
@Mikilll94

Description

@Mikilll94

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

Image

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

  1. Download repro project.
  2. Run npm install and then npm run dev
  3. Open devtools
  4. Do any change in App.tsx, i.e. change the content of h1 tag
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-edge-caseBug, but has workaround or limited in scope (priority)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions