Should handle when app server is reloaded via nodemon
See original GitHub issueI have it so that my app server (which, of course, contains webpack-dev-middleware and webpack-hot-middleware) is restarted when any server-side files are changed. Unfortunately, what’s happening is that as soon as the server is restarted, something is triggered such that now I see the following message in the browser console:
GET http://localhost:3000/__webpack_hmr net::ERR_INCOMPLETE_CHUNKED_ENCODING
I don’t know enough to know why this is happening exactly, but I do know that I’d like the page to reload when this happens. Any idea on how to do this?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:17
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Don't use nodemon, there are better ways! | by Kevin Simper
Okay, we know the solution is to not restart simply because then the server can not be down, but we still want to...
Read more >Using nodemon for auto-reload of server after code change for ...
Was a newbie to node.js, whenever I make a change in the code, In the terminal, I used to keep on hitting Ctrl+C...
Read more >How to Configure Nodemon to Auto-reload Node App?
We'll create a basic node app and if any change occurs in the app then nodemon will automatically restart the server for us....
Read more >Chapter V - Reload server upon changes (the smart way)
The most common way to handle server reloads is using nodemon. This tool wraps your script in a separate process, watches your files...
Read more >Refresh front and backend changes to browser with Express ...
Changed frontend files can be re-served without restarting Express. To freshen backend files, we'll restart the server using Nodemon and signal the browser...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You should at least configure nodemon to ignore the
client
folder, so that it only restarts on server changes.The client-side event-stream should reconnect after the server has restarted.
Feel free to reopen if you have more questions or suggestions.
Correct, the key point is here: https://github.com/glenjamin/ultimate-hot-reloading-example/blob/master/server.js#L28 Every request does a
require()
, which will use the require.cache if primed, or trigger a fresh require.Whenever the
/server/
files change, we clear the module cache: https://github.com/glenjamin/ultimate-hot-reloading-example/blob/master/server.js#L37