fix(front): Handle "Failed to fetch dynamically imported module" errors by refreshing the page
Reference: https://stackoverflow.com/a/74861436/10204399 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
b586f59288
commit
3d21a06789
@ -205,3 +205,12 @@ router.beforeEach(authGuardIfNeeded);
|
|||||||
// console.error(e);
|
// console.error(e);
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
router.onError((error, to) => {
|
||||||
|
if (
|
||||||
|
error.message.includes("Failed to fetch dynamically imported module") ||
|
||||||
|
error.message.includes("Importing a module script failed")
|
||||||
|
) {
|
||||||
|
window.location.href = to.fullPath;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user