-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
Describe the bug
When defining {@const}
using Svelte v5 preview, two spaces after the @const
keyword will result in an error. There is no problem if there is only one space. There is also no problem with Svelte v4.
Reproduction
e.g.
<script>
let list = [1, 2, 3];
</script>
{#each list as e}
{@const a = e * 2}
{e} * 2 = {a}<br>
{/each}
Logs
Error compiling App.svelte
{@const ...} must be an assignment
line 6 column 4
System Info
System:
OS: macOS 13.2.1
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Memory: 83.73 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.8.1 - /usr/local/bin/npm
pnpm: 8.5.0 - /usr/local/bin/pnpm
Browsers:
Chrome: 119.0.6045.199
Safari: 16.3
npmPackages:
svelte: ^5.0.0-next.15 => 5.0.0-next.15
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels