-
-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for '[HMR] You need to restart the application!' on server sided error #730
Conversation
It's not working for me. What reliably breaks HMR for me is a syntax error. E.g. put [[[[[[[[[ somewhere in one of your files. nodejs_1 | [7:23:02 PM] Compiling server After that, even with this patch, I'll see stuff like this in the log: but never |
@crosscompile does this happen to us too? cc @TheLarkInn any ideas about what would break HMR ? |
Note: This is for server sided errors only. In the following stack trace I imported a
|
ReferenceError and SyntaxError both block HMR for me on the server-side, with and without this patch. I never end up in the catch() |
My bad. I didn't include the whole solution. It should work now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool
@jaredpalmer did this actually work for you? It didn't make a difference for me. HMR was erroring before it called module.hot.accept |
@crosscompile is investigating this today. |
This is working for me locally, nice stuff @Bram-Zijp! @gregmartyn are you sure you have the entire patch? Initially I missed changing the server let app = require('./server').default; |
I did something similar. Tried again and it's working. Thanks! |
When you make an error (e.g. undefined variable) somewhere in the server.js, you need to restart the application. To prevent this you should only restart the server when there's no errors.