-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
Description
Describe the bug
I'm not sure if this should be in Svelte or Kit repo, but since it appeared with Svelte 5, i'm posting it here.
<svelte:element> is not properly hydrated when using SSR with SvelteKit.
With the following code, the page should render a button once hydrated:
- it does with Svelte 4
- it does not with Svelte 5
<script>
import { browser } from '$app/environment';
$: t = browser ? 'button' : 'div';
$: console.log('T', t);
</script>
<svelte:element this={t}>{t}</svelte:element>Reproduction
Logs
No response
System Info
System:
OS: Linux 5.0 undefined
CPU: (2) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
svelte: ^5.1.15 => 5.1.15Severity
blocking an upgrade
umwwwelt and gwennlbh