-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
TS Decorators don't work when using Vite 5.0.11 & TS 5.3.3 #15565
Comments
Start a new pull request in StackBlitz Codeflow. |
you have 2 nested compilerOptions definition in your tsconfig |
This is likely an issue with ts decorator metadata, which is used by The workaround is to use a different transpiler, but the official (Probably not recommended but you might be able to run tsc for transpilation. Just out of curiosity, I tested this plugin https://github.com/herberttn/vite-plugin-typescript-transform/ and it seems to work but I cannot guarantee anything https://github.com/hi-ogawa/repro-vite-ts-decorator-metadata (or stackblitz)) |
I'll close this as a duplicate of #4884 (comment) and "not planned". I'll put one more pointer here vitest-dev/vitest#708 where some people used swc to support decorator metadata for nestjs testing on Vitest. I hope it also gives some background of the issue and potential workaround. |
Describe the bug
When trying out the
typescript-json-serializer
project, I noticed that the latest versions of Vite doesn't read the contents oftsconfig.json
when specified invite.config.ts
Leading to (n chrome):
In both
tsconfig.json
andtsconfig.node.json
this is specified:When i specify this in the
vite.config.ts
, I get an error thatTS2769: No overload matches this call.
With this error, nothing appears in the Vite error log and i see this in my console display on Firefox:
On Chrome, i get this error:
Uncaught SyntaxError: Invalid or unexpected token (at organization.ts:5:1)
and the same error in chrome as before with output to the Vite console. I am unsure why Firefox doesn't log the error while chrome does, and why the decorator experimental behavior isn't registered in the config.
Reproduction
https://stackblitz.com/edit/vitejs-vite-mecubs?file=tsconfig.json
Steps to reproduce
run
vite dev
and launch in browserSystem Info
Used Package Manager
pnpm
Logs
Validations
The text was updated successfully, but these errors were encountered: