Skip to content
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

Merged
merged 2 commits into from
Sep 9, 2017

Conversation

Timer
Copy link
Contributor

@Timer Timer commented Sep 8, 2017

Fixes #3096

@Timer Timer added this to the 1.0.13 milestone Sep 8, 2017
@Timer Timer requested a review from gaearon September 8, 2017 19:31
// See https://github.com/facebookincubator/create-react-app/issues/3096
module.hot.addStatusHandler(function(status) {
if (status === 'check') {
window.location.reload();
Copy link
Contributor Author

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

Copy link
Contributor Author

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) {.

Copy link
Contributor

@gaearon gaearon left a 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.

@Timer
Copy link
Contributor Author

Timer commented Sep 9, 2017

I think this is a better approach too. 😄

Copy link
Contributor

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works

@Timer Timer merged commit 5e300ce into facebook:master Sep 9, 2017
@Timer Timer deleted the hotfix/hmr-runtime-error-reload branch September 9, 2017 02:52
matart15 pushed a commit to matart15/create-react-app that referenced this pull request Sep 13, 2017
…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)
thongdong7 pushed a commit to thongdong7/create-react-app that referenced this pull request Sep 24, 2017
* Reload the page when an error has occurred
Fixes facebook#3096

* Use a global boolean instead
thongdong7 pushed a commit to thongdong7/create-react-app that referenced this pull request Sep 24, 2017
* Reload the page when an error has occurred
Fixes facebook#3096

* Use a global boolean instead
kasperpeulen pushed a commit to kasperpeulen/create-react-app that referenced this pull request Sep 24, 2017
* Reload the page when an error has occurred
Fixes facebook#3096

* Use a global boolean instead
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants