Skip to content

Commit d9db9e3

Browse files
committed
fix
1 parent 9905a6b commit d9db9e3

File tree

1 file changed

+4
-1
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors

1 file changed

+4
-1
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/ConstTag.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export function ConstTag(node, context) {
1717
// TODO we can almost certainly share some code with $derived(...)
1818
if (declaration.id.type === 'Identifier') {
1919
const init = build_expression(context, declaration.init, node.metadata.expression);
20-
let expression = create_derived(context.state, b.thunk(init, is_expression_async(init)));
20+
let expression = create_derived(
21+
context.state,
22+
is_expression_async(init) ? b.arrow([], init, true) : b.thunk(init)
23+
);
2124

2225
if (dev) {
2326
expression = b.call('$.tag', expression, b.literal(declaration.id.name));

0 commit comments

Comments
 (0)