-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Runtime error overlay does not disappear when fixed with HMR #3096
Comments
After writing this, I realize that there's no way to know if the runtime error has been fixed and properly replaced with HMR. The HMR could have been a simple css change, unrelated to the runtime error. Feel free to close if you don't think this is an issue. |
What we need to figure out and ensure happens is that a HMR is declined after a runtime error so a full reload is required (and automatic). Does this sound reasonable to you? |
Yes, I think that would be a great 80/20 solution. |
Did this work before? I remember that we wanted this to work (force refreshing after any errors) but I'm not sure if it did. |
Looks like the code is still there, so I assume it never functioned the way we intended: |
I wonder if it worked before the refactoring. |
I saw this issue in the most recent react-dev-utils 3.x and now after upgrading to react-dev-utils 4. |
So it probably worked. We probably broke it in #2515. (cc @tharakawj) |
To be sure, can you check if this worked in |
Hm. In both versions, the page does two full refreshes if there's an error during the render (which runs as part of
However, if the runtime error is somewhere else, e.g. in an event handler, the behaviour in the OP appears. No page reloads, overlay stays up. |
Ok, so this wasn't a regression. Thanks for the information, @eirikurn! |
Fix up in #3098; basically forces a reload after the error overlay has been shown. |
* Reload the page when an error has occurred Fixes #3096 * Use a global boolean instead
* Reload the page when an error has occurred Fixes facebook#3096 * Use a global boolean instead
* Reload the page when an error has occurred Fixes facebook#3096 * Use a global boolean instead
* Reload the page when an error has occurred Fixes facebook#3096 * Use a global boolean instead
* Reload the page when an error has occurred Fixes facebook#3096 * Use a global boolean instead
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes
Which terms did you search for in User Guide?
Hot module replacement. Error overlay.
Environment
node -v
: 8.1.4npm -v
: 5.3.0yarn --version
: 1.0.1npm ls react-scripts
: 1.0.13Then, specify:
Steps to Reproduce
src/index.js
which re-renders the React app.throw new Error()
).Expected Behavior
The error overlay should disappear.
Actual Behavior
The error overlay stays in view. If I close the overlay, I can see the new state of the app, properly fixed.
The text was updated successfully, but these errors were encountered: