Closed printfn closed 4 months ago
Thanks for the repro. I will check it out later but probably something similar to https://github.com/vitejs/vite-plugin-react/issues/133
Thanks! I’ve checked, the “fixHMR” component from that thread also works around this bug.
Describe the bug
Hi, I'm having issues with HMR not reloading certain modules.
The issue seems to only occur when using react-router, react-redux and a lazily-loaded class-based component.
In the attached minimal reproduction, editing the "src/components/LazyClassComponent.tsx" file (route: "/d") triggers a hot module reload but does not update the page, requiring a hard refresh.
I'm using Firefox 116.0.2 on Windows, running Vite in WSL.
Reproduction
https://github.com/printfn/vite-hmr-test
Steps to reproduce
Run
npm install
followed bynpm run dev
. Open the page in the browser and navigate to the '/d' link. Edit the "src/components/LazyClassComponent.tsx" file. In the browser console it will say[vite] hot updated: /src/Router.tsx
, but the page content does not actually update. If you try the same thing on any of the other three routes, it will update as expected.System Info
Used Package Manager
npm
Logs
No response
Validations