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:
Dorian
2026-03-08 11:15:34 +00:00
co-authored by Claude Opus 4.6
parent 9a11c48487
commit 8a3480e5ab
3 changed files with 22 additions and 2 deletions
+8
View File
@@ -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)
}
})