Skip to content

Commit

Permalink
Fixes 3076: HMR update breaks in webworker due to window (and locatio…
Browse files Browse the repository at this point in the history
…n.reload) not existing in web worker context. (#3078)
  • Loading branch information
clintharris authored and DeMoorJasper committed Jun 1, 2019
1 parent 4b50182 commit 7ad25fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/parcel-bundler/src/builtins/hmr-runtime.js
Expand Up @@ -59,8 +59,8 @@ if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
assetsToAccept.forEach(function (v) {
hmrAcceptRun(v[0], v[1]);
});
} else {
window.location.reload();
} else if (location.reload) { // `location` global exists in a web worker context but lacks `.reload()` function.
location.reload();
}
}

Expand Down

0 comments on commit 7ad25fd

Please sign in to comment.