fix another problematic attempt to reload page from worker

This commit is contained in:
Sebastian Alff 2022-05-24 21:07:28 +02:00
parent 721547b9cf
commit b8270acc76
1 changed files with 9 additions and 2 deletions

View File

@ -14,12 +14,19 @@ if (module.hot) {
.check(true)
.then(function (updatedModules) {
if (!updatedModules) {
log("warning", "[HMR] Cannot find update. Need to do a full reload!");
log(
"warning",
"[HMR] Cannot find update. " + typeof window !== "undefined"
? "Need to do a full reload!"
: "Please reload manually!"
);
log(
"warning",
"[HMR] (Probably because of restarting the webpack-dev-server)"
);
window.location.reload();
if (typeof window !== "undefined") {
window.location.reload();
}
return;
}