mirror of https://github.com/webpack/webpack.git
fix error when trying to reload page from worker
This commit is contained in:
parent
2738eebc78
commit
0ddddf46b5
|
@ -38,10 +38,16 @@ if (module.hot) {
|
||||||
if (["abort", "fail"].indexOf(status) >= 0) {
|
if (["abort", "fail"].indexOf(status) >= 0) {
|
||||||
log(
|
log(
|
||||||
"warning",
|
"warning",
|
||||||
"[HMR] Cannot apply update. Need to do a full reload!"
|
`[HMR] Cannot apply update. ${(
|
||||||
|
typeof window !== "undefined"
|
||||||
|
? "Need to do a full reload!"
|
||||||
|
: "Please reload manually!"
|
||||||
|
)}`
|
||||||
);
|
);
|
||||||
log("warning", "[HMR] " + log.formatError(err));
|
log("warning", "[HMR] " + log.formatError(err));
|
||||||
window.location.reload();
|
if (typeof window !== "undefined") {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log("warning", "[HMR] Update failed: " + log.formatError(err));
|
log("warning", "[HMR] Update failed: " + log.formatError(err));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue