TypeScript 5 Decorators + Esbuild #19066
Replies: 4 comments
-
Oooh, decorators are not working at all:
|
Beta Was this translation helpful? Give feedback.
-
Apparently it only works with Experimental Decorators, not with the new official ones... |
Beta Was this translation helpful? Give feedback.
-
UpdateIt works with the new decorators, but only with
At least I can work with bun or tsx with watch mode. |
Beta Was this translation helpful? Give feedback.
-
Try changing esbuild.target option in vite.config.js export default {
esbuild: {
target: "es2022"
}
} This works for me. reference: #17308 |
Beta Was this translation helpful? Give feedback.
-
Hello 👋,
I read esbuild now supports TypeScript decorators.
I'm using
vite-plugin-vite
(express server app) andvite-tsconfig-paths
(to convert path aliases).The error is with the decorators. No matter if I add the decorators before or over the export keyboard, or after it, I get an error.
error during build: src/app/app.group.ts (5:0): Using the export keyword between a decorator and a class is not allowed. Please use
export @dec classinstead. (Note that you need plugins to import files that are not JavaScript)
Happens at dev and at build.
I tried with
overrides: { "esbuild": "^0.24.0"}
in mypackage.json
to force Vite to use latestesbuild
version.I'll appreciate any info, thank you.
Beta Was this translation helpful? Give feedback.
All reactions