-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
TypeError: next_sibling is null during hydration #14405
Comments
Thank you for fixing that, @trueadm. Can something be done to prevent similar errors from nuking the entire page in the future? One of the benefits from SSR is that even if JS fails, the HTML can still be displayed correctly. That error caused the entire DOM to be destroyed, leaving user with a blank page, even though the HTML was SSR-ed. |
I'm getting a similar error on my app ... not sure how to debug it?
Using svelte 5.20.2 |
Can you create a new issue, and maybe provide a repro or link to your code? A stack trace doesn't really help here. |
I can't figure out what caused it, so don't know how to make a minimal example... However turning on preserve whitespace fixed it:
|
Describe the bug
When certain component is SSR-ed, I get a type error during hydration (see logs section). Minimal reproduction I could make looks like this:
The problem is caused by spacing between
</span>
and{
. When I make the following change, the error no longer occurs:This crash causes Svelte to remove everything from DOM. Page that was server rendered not only isn't hydrated, but just goes blank.
Reproduction
Failing test: https://github.com/jrmajor/svelte/tree/c659c94d16a7306848935ff4ed11a4b4bb091873/packages/svelte/tests/hydration/samples/strange-spacing
Commit with tests to cherry pick: jrmajor@c659c94
Logs
System Info
System: OS: macOS 15.0 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 514.17 MB / 16.00 GB Shell: 3.7.1 - /usr/local/bin/fish Binaries: Node: 23.1.0 - /usr/local/bin/node Yarn: 1.22.22 - /usr/local/bin/yarn npm: 10.9.0 - /usr/local/bin/npm pnpm: 9.12.3 - /usr/local/bin/pnpm bun: 1.1.34 - /usr/local/bin/bun Browsers: Safari: 18.0 npmPackages: svelte: ^5.2 => 5.2.0
Severity
blocking all usage of svelte
The text was updated successfully, but these errors were encountered: