Skip to content

Commit

Permalink
fix: asynchronously instantiate components when using Svelte 5 (#12613)
Browse files Browse the repository at this point in the history
Adjusts the behavior to that of the new `mount`/`hydrate` APIs and also fixes #12248
  • Loading branch information
dummdidumm authored Sep 6, 2024
1 parent c584dc2 commit 873ec2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/big-vans-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: asynchronously instantiate components when using Svelte 5
4 changes: 3 additions & 1 deletion packages/kit/src/runtime/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,9 @@ function initialize(result, target, hydrate) {
root = new app.root({
target,
props: { ...result.props, stores, components },
hydrate
hydrate,
// @ts-ignore Svelte 5 specific: asynchronously instantiate the component, i.e. don't call flushSync
sync: false
});

restore_snapshot(current_navigation_index);
Expand Down

0 comments on commit 873ec2b

Please sign in to comment.