Describe the bug
Similar to #16811
<script>
async function getOne() {
return 1;
}
</script>
<svelte:boundary>
{@const one = await getOne()}
</svelte:boundary>
However, with pending snippet, it works.
<script>
async function getOne() {
return 1;
}
</script>
<svelte:boundary>
{@const one = await getOne()}
{#snippet pending()}
<p>loading...</p>
{/snippet}
</svelte:boundary>
Reproduction
https://www.sveltelab.dev/bz2hl12ptw022ry
Logs
[vite] (ssr) Error when evaluating SSR module /src/routes/+page.svelte: Parse failure: await isn't allowed in non-async function
At file: /src/routes/+page.svelte:17:17
File: /src/routes/+page.svelte:17:17
15 |
16 | {
17 | const one = (await $.save(getOne()))();
| ^
18 | }
19 |
System Info
Severity
blocking an upgrade