-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Svelte 5: Unexpected character '@' when using *.svelte.ts with Decorators and $state and importing in client #12205
Comments
This is basically a duplicate of #11502 |
Depends - I would have expected the typescript plugin to run on that file first, which would then down level the decorator. Wondering why that isn't the case, and whether that's due to specific tsconfig settings. Please provide a proper reproduction link so we can investigate |
(Its me @gemue-parndt just from my personal account) @dummdidumm I just uploaded a reproduceable example. example.zip I also figured out it doesn't depends on the runtime, it doesn't work neither with Bun nor with Node. |
here you go |
This is definetly unrelated to Svelte, therefore closing. I'd still wanted to figure out why decorators aren't downleveled though. AFAIK ESbuild supports decorators, and so does TS 5.0+, so I would've thought that Vite would downlevel them. Things I tried without success:
What finally worked, thanks to pointers in vitejs/vite#17308:
What also works, but which isn't really what one should do going forward is to set |
Describe the bug
I can't use a class with a decorated method.
Reproduction
Generate a decorator in a file , use the decorator on a class method and import the class in the client side.
test.svelte.ts
+page.svelte
Results in:
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: