Skip to content

Instantly share code, notes, and snippets.

@haigopi
Last active December 30, 2021 19:53
Show Gist options
  • Save haigopi/07aadee679cd8920bb5e621fe163bc03 to your computer and use it in GitHub Desktop.
Save haigopi/07aadee679cd8920bb5e621fe163bc03 to your computer and use it in GitHub Desktop.
ChunkLoadError
router.onError(error => {
console.error(error);
Vue.prototype.$log.error('Failure Reason: ', error.message, error);
if (/ChunkLoadError:.*failed./i.test(error.message)) {
Vue.prototype.$log.error('Reloading Window 1');
window.location.reload();
}
else if (/Loading.*chunk.*failed./i.test(error.message)) {
Vue.prototype.$log.error('Reloading Window 2');
window.location.reload();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment