Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4: hydration doesn't restore a static value that changes on the browser #8683

Closed
gtm-nayan opened this issue Jun 1, 2023 · 1 comment
Closed

Comments

@gtm-nayan
Copy link
Contributor

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

@benmccann benmccann added this to the 4.x milestone Jun 1, 2023
@benmccann
Copy link
Member

fixed in #8744

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants