fix(pwa): completely destroy service worker cache and fix chunk load errors to stop freezing
This commit is contained in:
@ -181,4 +181,11 @@ router.beforeEach(async (to, _from, next) => {
|
||||
next()
|
||||
})
|
||||
|
||||
router.onError((error, to) => {
|
||||
// Si falla la carga de un chunk (al actualizar la app), recarga la página para obtener la última versión
|
||||
if (error.message.includes('Failed to fetch dynamically imported module') || error.message.includes('Importing a module script failed')) {
|
||||
window.location.href = to.fullPath
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user