Svelte 5.43.0+: Function bindings and `await` in a single component cause an error
Closed this issue · 1 comments
Serator commented
Describe the bug
The following code causes an error:
<script lang="ts">
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms))
const test = await delay(1000)// <<< ❌ causes an error
let width = $state(0)
const updateWidth = (value: DOMRectReadOnly) => (width = value.width)
</script>
<div bind:contentRect={null, updateWidth}></div>
{width}
Reproduction
Logs
System Info
-Severity
annoyance
Antonio-Bennett commented
I think this is a dupe of #17090?