Reputation: 21
I am setting up a boilerplate using React and Vite to build the frontend of my Electron application, the boilerplate is almost done I just need to add hot reloading to the React app. The issue that I am having is that when I change a file and save it the change is detected by the HMR (change detections IS logged to the terminal) but it is not updated in the browser (even if refreshing the page) until I save it a second time without even changing anything.
I installed the vitejs/plugin-react plugin as it is required for HMR with React but it still gives this issue.
Upvotes: 2
Views: 721
Reputation: 11
Same here, only what i found, that its saves (copy) of your file into cache, and then updates it twice (or 3 times), and last updates comes from cache which means, it's doesn't have last changes. I still have no idea how to fix this, but at least something...(
Upvotes: 0