fix: handle stale chunk 404s + add page loading states
- Router catches failed dynamic imports and forces reload (stale deploy cache) - LeaderboardPage: sprite-based loading animation while fetching - ArenaPage: sprite-based loading animation while fetching Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9a11c48487
commit
8a3480e5ab
@@ -67,3 +67,11 @@ export const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes,
|
||||
})
|
||||
|
||||
// Handle stale chunk 404s after deploy — force reload to get new assets
|
||||
router.onError((err, to) => {
|
||||
if (err.message.includes('Failed to fetch dynamically imported module') ||
|
||||
err.message.includes('Importing a module script failed')) {
|
||||
window.location.assign(to.fullPath)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user