Skip to content

Commit 321d960

Browse files
committed
Fix dismissed error overlays
1 parent 9a8fc4d commit 321d960

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/react-dev-utils/webpackHotDevClient.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function handleSuccess() {
106106
tryApplyUpdates(function onHotUpdateSuccess() {
107107
// Only dismiss it when we're sure it's a hot update.
108108
// Otherwise it would flicker right before the reload.
109-
ErrorOverlay.dismissBuildError();
109+
tryDismissErrorOverlay();
110110
});
111111
}
112112
}
@@ -147,7 +147,7 @@ function handleWarnings(warnings) {
147147
tryApplyUpdates(function onSuccessfulHotUpdate() {
148148
// Only dismiss it when we're sure it's a hot update.
149149
// Otherwise it would flicker right before the reload.
150-
ErrorOverlay.dismissBuildError();
150+
tryDismissErrorOverlay();
151151
});
152152
}
153153
}
@@ -179,6 +179,12 @@ function handleErrors(errors) {
179179
// We will reload on next success instead.
180180
}
181181

182+
function tryDismissErrorOverlay() {
183+
if (!hasCompileErrors) {
184+
ErrorOverlay.dismissBuildError();
185+
}
186+
}
187+
182188
// There is a newer version of the code available.
183189
function handleAvailableHash(hash) {
184190
// Update last known compilation hash.

0 commit comments

Comments
 (0)