react-proto icon indicating copy to clipboard operation
react-proto copied to clipboard

HMR is working fine but when refreshing the page it's showing a text content Mismatch

Open rishcool opened this issue 2 years ago • 1 comments

HMR is working fine but when refreshing the page it's showing a text content Mismatch, So on the client side it's working well, but on the server need to again restart the nodemon after that the changes are appearing.

rishcool avatar Aug 19 '23 11:08 rishcool

Hi! Sorry for so late response.

Yes, server is running HMR and after changing something on client side server renders old version of the content and should be restarted if you are going to use new SSR with changes.

Nodemon is configured for server code changes and it rebuilds everything. It is possible to change its configuration: "start": "nodemon --exec npm run dev --watch src/server --ext ts,tsx,json " -> "start": "nodemon --exec npm run dev --watch src/ --ext ts,tsx,json " but in this case every change will lead to the rebuilding whole project and HMR is losing its sense.

As I know, it is impossible to have two different HMR for server and for client.

So, you can use static run for working on client side or just not to reload page during this work with SSR.

What is your thoughts?

Thanks!

StopNGo avatar Sep 13 '24 18:09 StopNGo