-
-
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
Reload the page when an error has occurred #3098
Conversation
// See https://github.com/facebookincubator/create-react-app/issues/3096 | ||
module.hot.addStatusHandler(function(status) { | ||
if (status === 'check') { | ||
window.location.reload(); |
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.
Instead of doing this here, we may just want to replace all of this with a boolean we set to true, then check here:
https://github.com/facebookincubator/create-react-app/blob/fcb6dc55578e089e9f62f6e6c12cb9b60a57fee5/packages/react-dev-utils/webpackHotDevClient.js#L229-L233
/cc @gaearon
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.
Effectively, if (err || !updatedModules || hadRuntimeError) {
.
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.
Your suggestion with setting a boolean makes sense to me. I was thinking that too.
I think this is a better approach too. 😄 |
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.
If it works
…react-app * 'master' of https://github.com/facebookincubator/create-react-app: Resolved issue facebook#2971 (facebook#2989) Revert "run npm 5.4.0 in CI (facebook#3026)" (facebook#3107) Updated react-error-overlay to latest Flow (0.54.0) (facebook#3065) Auto-detect running editor on Linux for error overlay (facebook#3077) Clean target directory before compiling overlay (facebook#3102) Rerun prettier and pin version (facebook#3058) Reload the page when an error has occurred (facebook#3098) run npm 5.4.0 in CI (facebook#3026) Unmapper Windows compatibility (facebook#3079) Update eslint-config npm install command (facebook#3072) Set travis config to use 'precise' ci environment Publish Changelog for 1.0.13 Add missing slash Make error overlay filename configurable (facebook#3028) provide empty mock for child_process so importing libraries with it works (facebook#3033) Rename Overlay to ErrorOvelay (facebook#3051) Strip hash from chunk file name (facebook#3049) Fix error overlay 'Object.assign' issue in IE by including polyfills before webpack client (facebook#3046)
* 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
Fixes #3096