File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,18 @@ var ErrorOverlay = require('react-error-overlay');
28
28
ErrorOverlay . startReportingRuntimeErrors ( {
29
29
launchEditorEndpoint : launchEditorEndpoint ,
30
30
onError : function ( ) {
31
- // TODO: why do we need this?
32
- if ( module . hot && typeof module . hot . decline === 'function' ) {
33
- module . hot . decline ( ) ;
31
+ // Ensure HotModuleReplacementPlugin is active
32
+ if ( module . hot && typeof module . hot . addStatusHandler === 'function' ) {
33
+ // When a run time error occurs, it does not make sense to continue HMR;
34
+ // as application state may be corrupted.
35
+ // So, next time we check for updates, simply reload the page (to
36
+ // abort the process).
37
+ // See https://github.com/facebookincubator/create-react-app/issues/3096
38
+ module . hot . addStatusHandler ( function ( status ) {
39
+ if ( status === 'check' ) {
40
+ window . location . reload ( ) ;
41
+ }
42
+ } ) ;
34
43
}
35
44
} ,
36
45
filename : '/static/js/bundle.js' ,
You can’t perform that action at this time.
0 commit comments