Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
Might be somewhat related to #17209. While the issue shows in kit, I assume the cause is somewhere within svelte proper, so filing here.
When using async in SvelteKit, preloading data may cause a loss of reactivity. While it seems that the value is updated (at least $inspect() suggests as much), the $effect() is not executed.
This can be triggered by both using data-sveltekit-preload-data or making use of preloadData().
Reproduction
https://stackblitz.com/edit/sveltekit-reactivity-loss?file=src%2Froutes%2F%2Bpage.svelte
Initially, opening the dialog both via button or the anchor works.
Once root +page.svelte is adjusted by either setting triggerError to true or data-sveltekit-preload-data to hover, opening the dialog via the button only works as long as the link has not been hovered or clicked.
Inspecting dialogShowing in lib/SvelteDialog.svelte indicates the variable is updating but the effect not firing.
Logs
System Info
System: OS: macOS 26.1 CPU: (10) arm64 Apple M2 Pro Memory: 65.02 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.11.1 - /opt/homebrew/opt/node@24/bin/node npm: 11.6.2 - /opt/homebrew/opt/node@24/bin/npm Browsers: Edge: 142.0.3595.94 Firefox: 145.0.2 Safari: 26.1 npmPackages: svelte: ^5.42.2 => 5.45.5Severity
blocking an upgrade