From 6b1e8e878e73119b076b86b0ef347922a27e05c9 Mon Sep 17 00:00:00 2001 From: Till JS Date: Wed, 15 Apr 2026 15:33:35 +0200 Subject: [PATCH] fix(web): guard PwaUpdatePrompt against SSR navigator access useRegisterSW() reaches for navigator.serviceWorker at call time, which crashes SvelteKit SSR with "ReferenceError: navigator is not defined" (Node has no navigator). The prod mana-web container crash-looped on every request after the rebuild because the layout mounts this component unconditionally. Fix: branch on \$app/environment's \`browser\` flag. On the server, hand back a noop writable + async-noop updater so the downstream template code stays unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/lib/components/PwaUpdatePrompt.svelte | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/apps/mana/apps/web/src/lib/components/PwaUpdatePrompt.svelte b/apps/mana/apps/web/src/lib/components/PwaUpdatePrompt.svelte index 1060a153a..a2f3ed767 100644 --- a/apps/mana/apps/web/src/lib/components/PwaUpdatePrompt.svelte +++ b/apps/mana/apps/web/src/lib/components/PwaUpdatePrompt.svelte @@ -1,19 +1,24 @@