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 });