fix: wrap async `children` in `$$renderer.async` (#16862)

main
ComputerGuy 8 hours ago committed by GitHub
parent 8895bd44f5
commit 87f7e97963
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: wrap async `children` in `$$renderer.async`

@ -242,7 +242,12 @@ export function build_inline_component(node, expression, context) {
params.push(pattern);
}
const slot_fn = b.arrow(params, b.block(block.body));
const slot_fn = b.arrow(
params,
node.fragment.metadata.has_await
? b.block([create_async_block(b.block(block.body))])
: b.block(block.body)
);
if (slot_name === 'default' && !has_children_prop) {
if (

@ -0,0 +1,4 @@
<script>
const { children } = $props();
</script>
{@render children()}

@ -0,0 +1,7 @@
<script>
import Component from "./component.svelte";
</script>
<Component>
{@const one = await 1}
{one}
</Component>
Loading…
Cancel
Save