-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
Describe the bug
When using the rest props like so let { ...rest } = $props(); inside of a svelte file with <script lang="ts> an error shows up saying
`p` has already been declaredsvelte(declaration_duplicate)
To Reproduce
Create a svelte component like the following
<script lang="ts">
let { ...rest }: { test: string } = $props();
</script>
I am using esbuild-svelte but the error goes away if I don't use svelte-preprocess
✘ [ERROR] `p` has already been declared [plugin esbuild-svelte]
second.svelte:6:24:
6 │ let { ...rest } = $props();
Expected behavior
I should be able to use the rest props syntax in a typescript svelte file
Information about your project:
OS: Ubuntu Linux
svelte-preprocess version 6.0.3
Additional Info
The error also shows up for me when using vscode with the Svelte for VSCode extension
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels