diff --git a/apps/mana/apps/web/src/routes/offline/+page.ts b/apps/mana/apps/web/src/routes/offline/+page.ts index 1b7861cd8..5990bac06 100644 --- a/apps/mana/apps/web/src/routes/offline/+page.ts +++ b/apps/mana/apps/web/src/routes/offline/+page.ts @@ -1,10 +1,16 @@ -// FIXME: prerender is disabled because the SvelteKit prerender worker -// throws "Error: 500 /offline" with no usable stack trace during the -// production build. Suspected cause: a module-level side-effect on the -// shared layout (vault-client? data-layer-listeners?) that fails when -// no `window` is available. SSR'ing the offline page at request time -// is harmless — it's a static "you're offline" message — but the real -// fix is to find which import throws on the bare server and guard it. +// `/offline` ist die Workbox-navigate-fallback. Zwei Dinge sind nötig: // -// First observed: 2026-04-07 during Memoro recording pipeline deploy. -export const prerender = false; +// 1. `prerender = true` — sonst landet die Page nicht in +// `prerendered/offline.html`, und der @mana/shared-pwa-Workbox-Config +// matched nur `**/*.html`. Ohne wirft Workbox beim SW-Register +// `non-precached-url: /offline`. +// +// 2. Die Page lebt unter `+page@.svelte` (statt `+page.svelte`) — die +// `@`-Notation bricht aus der Layout-Chain aus. Das Root-Layout +// zieht Dexie / encryption-vault / data-layer-listeners / auth-store +// rein; beim Build-SSR throw't Browser-Code (window/document/ +// indexedDB). Genau das war der „Error: 500 /offline"-Crash, der +// 2026-04-07 zum prerender=false-FIXME geführt hatte. Mit @-Suffix +// hängt die Page direkt am SvelteKit-Root, kein Eltern-Layout — die +// OfflinePage aus @mana/shared-ui kommt ohne Stores aus. +export const prerender = true;