Closed
Description
Describe the bug
I'm guessing this is related to #7426.
Two SvelteKit tests started failing with version 4 as reported by ecosystem-ci, both of them were using the BROWSER
variable from esm-env to display different content on the browser than on the server.
The compiler perceives the condition variable to be static and the generated code doesn't attempt to restore the html to the actual value at that moment.
Reproduction
https://github.com/sveltejs/svelte/tree/v4-hydration-bug
git clone https://github.com/sveltejs/svelte/tree/v4-hydration-bug
cd svelte/packages/playground
pnpm i
pnpm dev
Go to localhost:10001
Logs
None
System Info
n/a
Severity
blocking an upgrade
Metadata
Metadata
Assignees
Labels
No labels