ogygia warning
hydration_ discarded
island "‹entry›" discarded its ENTIRE server-rendered DOM during hydration and re-rendered client-side (Svelte hydration-mismatch recovery). Three things cause this. (1) Something changed this region's HTML between SSR and wake — a post-SSR transform (transformPageChunk / an HTML-rewriting middleware), an A/B-testing snippet, or an edge rewriter; whatever it injected (e.g. declarative shadow DOM) was just destroyed, and the swap is timing-dependent, so symptoms look erratic. (2) A component in this island reads a page/layout CONTEXT via plain Svelte setContext — on csr=false that runs only on the server, so getContext returns undefined on the client and the island renders a different tree. (3) A block in this island ({#if} / {:else if} / {#each} / {#await}) took a DIFFERENT branch on the client than on the server — its condition reads something that differs between the two (a browser global, a store's client default, url/page state, a Date). Svelte recovers a branch mismatch SILENTLY (no throw); the walk is then off and the rest of the tree follows.
What changed: ‹drift›
Svelte threw on the strict attempt (after repair): ‹strict›
Fix: for (1) make the mutation invisible to hydration (mutate only <head>, attributes, or shadow templates — never the region's light DOM), or freeze the foreign-owned subtree with a wake:'none' (lake) boundary; for (2) provide the value with setContext / <Provide> / createContext imported from 'ogygia', read it with the same getContext(key); for (3) make the condition read the same value on both sides (a prop / page.data), or move the browser-only branch behind an $effect / hydratedBy(). Svelte could not adopt the island's server HTML, so it threw it away and rendered the island again in the browser: a flash, and anything injected into that HTML is gone. Three things cause it.
1. Something changed the region's HTML between the server render and the wake: a post-SSR transform (transformPageChunk, an HTML-rewriting middleware), an A/B-testing snippet, an edge rewriter. drift names the first difference. Mutate only the head, attributes or shadow templates, never the region's light DOM, or freeze that subtree in a lake (wake: 'none').
2. A component reads a page or layout context set with plain setContext. On a csr=false page that runs only on the server, so the browser renders a different tree. Provide the value with setContext / <Provide> / createContext imported from ogygia.
3. A block (if, each, await) took a different branch in the browser than on the server: its condition reads a browser global, a store's client default, URL state or a date. With no drift and no strict error this is the cause. Make the condition read the same value on both sides (a prop, page.data), or move the browser-only branch behind an $effect or hydratedBy().