@@ -38,7 +38,7 @@ function createOverlayIframe(onIframeLoad) {
38
38
iframe . style . width = '100vw' ;
39
39
iframe . style . height = '100vh' ;
40
40
iframe . style . border = 'none' ;
41
- iframe . style . zIndex = 9999999999 ;
41
+ iframe . style . zIndex = 2147483647 ;
42
42
iframe . onload = onIframeLoad ;
43
43
return iframe ;
44
44
}
@@ -192,22 +192,24 @@ function clearOutdatedErrors() {
192
192
// Successful compilation.
193
193
function handleSuccess ( ) {
194
194
clearOutdatedErrors ( ) ;
195
- destroyErrorOverlay ( ) ;
196
195
197
196
var isHotUpdate = ! isFirstCompilation ;
198
197
isFirstCompilation = false ;
199
198
hasCompileErrors = false ;
200
199
201
200
// Attempt to apply hot updates or reload.
202
201
if ( isHotUpdate ) {
203
- tryApplyUpdates ( ) ;
202
+ tryApplyUpdates ( function onHotUpdateSuccess ( ) {
203
+ // Only destroy it when we're sure it's a hot update.
204
+ // Otherwise it would flicker right before the reload.
205
+ destroyErrorOverlay ( ) ;
206
+ } ) ;
204
207
}
205
208
}
206
209
207
210
// Compilation with warnings (e.g. ESLint).
208
211
function handleWarnings ( warnings ) {
209
212
clearOutdatedErrors ( ) ;
210
- destroyErrorOverlay ( ) ;
211
213
212
214
var isHotUpdate = ! isFirstCompilation ;
213
215
isFirstCompilation = false ;
@@ -231,6 +233,9 @@ function handleWarnings(warnings) {
231
233
// Only print warnings if we aren't refreshing the page.
232
234
// Otherwise they'll disappear right away anyway.
233
235
printWarnings ( ) ;
236
+ // Only destroy it when we're sure it's a hot update.
237
+ // Otherwise it would flicker right before the reload.
238
+ destroyErrorOverlay ( ) ;
234
239
} ) ;
235
240
} else {
236
241
// Print initial warnings immediately.
0 commit comments