fix error when trying to reload page from worker

This commit is contained in:
Sebastian Alff 2022-05-24 18:12:56 +02:00 committed by GitHub
parent 2738eebc78
commit 0ddddf46b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -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));
}