@@ -38,7 +38,7 @@ function createOverlayIframe(onIframeLoad) {
3838 iframe . style . width = '100vw' ;
3939 iframe . style . height = '100vh' ;
4040 iframe . style . border = 'none' ;
41- iframe . style . zIndex = 9999999999 ;
41+ iframe . style . zIndex = 2147483647 ;
4242 iframe . onload = onIframeLoad ;
4343 return iframe ;
4444}
@@ -192,22 +192,24 @@ function clearOutdatedErrors() {
192192// Successful compilation.
193193function handleSuccess ( ) {
194194 clearOutdatedErrors ( ) ;
195- destroyErrorOverlay ( ) ;
196195
197196 var isHotUpdate = ! isFirstCompilation ;
198197 isFirstCompilation = false ;
199198 hasCompileErrors = false ;
200199
201200 // Attempt to apply hot updates or reload.
202201 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+ } ) ;
204207 }
205208}
206209
207210// Compilation with warnings (e.g. ESLint).
208211function handleWarnings ( warnings ) {
209212 clearOutdatedErrors ( ) ;
210- destroyErrorOverlay ( ) ;
211213
212214 var isHotUpdate = ! isFirstCompilation ;
213215 isFirstCompilation = false ;
@@ -231,6 +233,9 @@ function handleWarnings(warnings) {
231233 // Only print warnings if we aren't refreshing the page.
232234 // Otherwise they'll disappear right away anyway.
233235 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 ( ) ;
234239 } ) ;
235240 } else {
236241 // Print initial warnings immediately.
0 commit comments