Add note that TypeScript's emitDecoratorMetadata flag is not supported #2017
dummdidumm
started this conversation in
General
Replies: 1 comment 1 reply
-
You can also use the Babel plugin to customize how Snowpack builds your JS, instead of our less customizable built-in esbuild-er. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I tried using
tsyringe
, a library using decorators for constructor dependency injection. To my surprise it did not work. After some digging I found out that the problem is thatESBuild
, which is used by Snowpack to compile the code, does not support TypeScript'semitDecoratorMetadata
flag, which in this case is needed. (this meansinversify
will likely suffer from the same problem)I'm posting this here so others in the future can find the reason for the problem quicker. I also suggest to put a note about this into the snowpack docs about this.
In ideal world, this is implemented at some point in
ESBuild
, but several closed issues about this topic in that repo hint that this may never be the case.Beta Was this translation helpful? Give feedback.
All reactions