-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Svelte 5: Displaying component-bound prop causes ERR_SVELTE_HYDRATION_MISMATCH #10426
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
Comments
Added some more test cases to the repo. |
The minimum reproducible is just Out of curiousity: This kind of binding pattern is likely an error in Svelte 5 runes mode (i.e. having a undefined value bound to a property with a fallback value). What's the use case for this, and can you work around it by just initializing the value in the parent? |
There's no special use case, I think I was copying a component from a failing test, and added some text. Didn't see that the initialization is backwards! I can certainly initialize it in the parent instead. |
When there's only a single expression tag and its value evaluates to the empty string, special handling is needed to create and insert a text node fixes #10426
* fix: handle sole empty expression tags When there's only a single expression tag and its value evaluates to the empty string, special handling is needed to create and insert a text node fixes #10426 * fix * need this, too * Update packages/svelte/src/internal/client/operations.js --------- Co-authored-by: Rich Harris <[email protected]>
Describe the bug
When binding a prop to a component prop and displaying it in certain circumstances, in the browser there is a
ERR_SVELTE_HYDRATION_MISMATCH
error.It varies quite a lot when it fails, so the repo gives the details in code.
Reproduction
https://github.com/ciscoheat/svelte5-bind-hydrate
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: