Open vultix opened 7 months ago
This is probably a table-browser-auto-inserts-thead/tbody hydration mismatch thing. Probably the only way to fix this is to check and error in dev mode before the html string is sent over the wire.
@dummdidumm I've managed to get the same error, this time using only <div>
elements. The error seems to be due to nesting the elements.
I have a similar problem. I have an SEO component that writes something to
I have the same errors with Svelte 5.0.0-next.1 in Sveltekit,
Describe the bug
When using a sveltekit project with the new svelte 5 preview, I'm getting a hydration error when trying to pass child elements. This error occurs both when using
<slot/>
and{@render children()}
.This only seems to occur if a few conditions hold:
td
,tr
,th
,tbody
,tr
,thead
and you render the child elements in a#each
block<Div><Div>hi</Div></Div>
)Reproduction
Here's a stackblitz reproduction of the problem: https://stackblitz.com/edit/sveltejs-kit-template-default-xzcrsi?description=The%20default%20SvelteKit%20template,%20generated%20with%20create-svelte&file=package.json,src%2Froutes%2FTable.svelte,src%2Froutes%2F%2Bpage.svelte,src%2Fapp.d.ts&title=SvelteKit%20Default%20Template
After opening the stackblitz link, open devtools and note the error message.
Basic reproduction steps:
<slot/>
or{@render children()}
#each
block, rendering any table element (td
,tr
, etc)I have another reproduction using the nested element approach here: https://stackblitz.com/edit/sveltejs-kit-template-default-8bn5tx?description=The%20default%20SvelteKit%20template,%20generated%20with%20create-svelte&file=package.json,src%2Froutes%2F%2Bpage.svelte,src%2Froutes%2FDiv.svelte&title=SvelteKit%20Default%20Template
Logs
System Info
Severity
blocking an upgrade
Additional Information
No response