From ceb22a9898f7045171032968619faf209aad26e6 Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Wed, 30 Sep 2026 12:06:34 -0400 Subject: [PATCH] A stale tab's reload no longer throws: a retired chunk resolves to nothing, and nothing is mounted The preload-error handler claims the failed import and reloads; the import then resolves empty, and destructuring its default threw (WIZWAR-X). Fixes WIZWAR-X Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016ZtFMp1AtjXPBY4Z69Tx81 --- packages/web/src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/web/src/main.ts b/packages/web/src/main.ts index aaadf6f..3dfcd00 100644 --- a/packages/web/src/main.ts +++ b/packages/web/src/main.ts @@ -35,6 +35,8 @@ const target = document.getElementById("app")!; const page = location.pathname.startsWith("/watch/") ? import("./SharePage.svelte") : import("./App.svelte"); -page.then(({ default: Root }) => mount(Root, { target })); +// A retired chunk resolves to nothing once the handler above has claimed it; +// the reload is already on its way, so there is nothing to mount. +page.then((m) => m && mount(m.default, { target })); // The hall-wide notice sits above the game, apart from it: every game of Kestrel's Hall shows the same one. mount(Announcement, { target: document.body, anchor: document.body.firstChild ?? undefined });