From 98207eb1fc5a57e6ce52a358328e604774a15e16 Mon Sep 17 00:00:00 2001 From: Till JS Date: Wed, 20 May 2026 14:42:14 +0200 Subject: [PATCH] chore(mana-web): /offline-Kommentar updated nach Layout-Bypass-Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Folge-Commit zu a0a463a4f. Der FIXME-Block in +page.ts war noch der alte „prerender = false weil 500-Crash" — jetzt ersetzt durch die Erklärung warum @-Notation + prerender = true die saubere Lösung sind. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../mana/apps/web/src/routes/offline/+page.ts | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) 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;