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) {
|
||||
log(
|
||||
"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));
|
||||
if (typeof window !== "undefined") {
|
||||
window.location.reload();
|
||||
}
|
||||
} else {
|
||||
log("warning", "[HMR] Update failed: " + log.formatError(err));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue