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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ZtFMp1AtjXPBY4Z69Tx81
This commit is contained in:
Eric Wagoner
2026-09-30 12:06:34 -04:00
co-authored by Claude Opus 5.5
parent cbf897ff13
commit ceb22a9898
+3 -1
View File
@@ -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 });