-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Closed
Copy link
Labels
Description
Describe the bug
I'm trying to define an async function with rest parameters in a Svelte component using TypeScript:
<script lang="ts">
const f = async (...args: any) => {
}
</script>
Svelte's parser throws an "Unexpected token" error when trying to parse the rest parameters syntax:
Unexpected token
https://svelte.dev/e/js_parse_error
(js_parse_error)
Reproduction
Logs
System Info
System:
OS: macOS 15.2
CPU: (12) arm64 Apple M2 Max
Memory: 3.30 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - /usr/local/bin/node
npm: 10.9.2 - /usr/local/bin/npm
pnpm: 10.3.0 - /usr/local/bin/pnpm
bun: 1.1.6 - ~/.bun/bin/bun
Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman
Browsers:
Brave Browser: 131.1.73.105
Chrome: 133.0.6943.55
Safari: 18.2
Severity
annoyance
zachstence