@@ -107,7 +107,7 @@ function handleSuccess() {
107107 tryApplyUpdates ( function onHotUpdateSuccess ( ) {
108108 // Only dismiss it when we're sure it's a hot update.
109109 // Otherwise it would flicker right before the reload.
110- ErrorOverlay . dismissBuildError ( ) ;
110+ dismissBuildErrorIFNotWaiting ( ) ;
111111 } ) ;
112112 }
113113}
@@ -148,7 +148,7 @@ function handleWarnings(warnings) {
148148 tryApplyUpdates ( function onSuccessfulHotUpdate ( ) {
149149 // Only dismiss it when we're sure it's a hot update.
150150 // Otherwise it would flicker right before the reload.
151- ErrorOverlay . dismissBuildError ( ) ;
151+ dismissBuildErrorIFNotWaiting ( ) ;
152152 } ) ;
153153 }
154154}
@@ -186,6 +186,14 @@ function handleAvailableHash(hash) {
186186 mostRecentCompilationHash = hash ;
187187}
188188
189+ function dismissBuildErrorIFNotWaiting ( ) {
190+ if ( isWaitingForTypes ) {
191+ return ;
192+ }
193+
194+ ErrorOverlay . dismissBuildError ( ) ;
195+ }
196+
189197// Handle messages from the server.
190198connection . onmessage = function ( e ) {
191199 var message = JSON . parse ( e . data ) ;
@@ -207,6 +215,9 @@ connection.onmessage = function(e) {
207215 case 'wait-for-types' :
208216 isWaitingForTypes = message . data ;
209217 break ;
218+ case 'dismiss-build-error' :
219+ ErrorOverlay . dismissBuildError ( ) ;
220+ break ;
210221 case 'errors' :
211222 handleErrors ( message . data ) ;
212223 break ;
@@ -225,7 +236,7 @@ function isUpdateAvailable() {
225236
226237// Webpack disallows updates in other states.
227238function canApplyUpdates ( ) {
228- return module . hot . status ( ) === 'idle' && ! isWaitingForTypes ;
239+ return module . hot . status ( ) === 'idle' ;
229240}
230241
231242// Attempt to update code on the fly, fall back to a hard reload.
0 commit comments