Skip to content

Commit 24944e6

Browse files
authored
fix: async class: + spread attributes were compiled into sync server-side code (#16834)
1 parent c75e862 commit 24944e6

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

.changeset/tasty-snails-dress.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: async `class:` + spread attributes were compiled into sync server-side code

packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ function build_element_spread_attributes(
372372
directive.name,
373373
directive.expression.type === 'Identifier' && directive.expression.name === directive.name
374374
? b.id(directive.name)
375-
: /** @type {Expression} */ (context.visit(directive.expression))
375+
: transform(
376+
/** @type {Expression} */ (context.visit(directive.expression)),
377+
directive.metadata.expression
378+
)
376379
);
377380
});
378381

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!--[--><div class="test"></div><div style="color: green;"></div><!--]-->
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<div class:test={await true} {...{}}></div>
2+
<div style:color={await "green"} {...{}}></div>

0 commit comments

Comments
 (0)