Skip to content
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

Transforming JavaScript decorators to the configured target environment ("nodeXX.Y.Z") is not supported yet #3496

Closed
darcyrush opened this issue Nov 16, 2023 · 4 comments

Comments

@darcyrush
Copy link

I already checked 3482 and filed an issue with tsx (which uses esbuild under the hood), who in turn requested to file the issue here.

I am using the nestjs framework's decorators along with tsx and a tsconfig.json with "experimentalDecorators": true but the issue persists.

I am using node 21.2.0 and tsx 4.1.2 on linux.

Here is a minimal reproduction repository

@evanw
Copy link
Owner

evanw commented Nov 16, 2023

If you run your code through esbuild without tsx involved then it works fine: https://esbuild.github.io/try/#dAAwLjE5LjUAewogIGxvYWRlcjogJ3RzJywKICB0YXJnZXQ6IFsnbm9kZTIxLjIuMCddLAogIHRzY29uZmlnUmF3OiB7CiAgICBjb21waWxlck9wdGlvbnM6IHsKICAgICAgZXhwZXJpbWVudGFsRGVjb3JhdG9yczogdHJ1ZSwKICAgIH0sCiAgfSwKfQBpbXBvcnQgeyBDb250cm9sbGVyLCBHZXQgfSBmcm9tICJAbmVzdGpzL2NvbW1vbiIKCkBDb250cm9sbGVyKCkKZXhwb3J0IGNsYXNzIEhlYWx0aENvbnRyb2xsZXIgewogIEBHZXQoJ2hlYWx0aC9yZWFkaW5lc3MnKQogIGFzeW5jIHJlYWRpbmVzcygpOiBQcm9taXNlPHZvaWQ+IHsgfQp9. I only get that error if I set experimentalDecorators: false. So the problem appears to be with tsx, not with esbuild. Perhaps something about your tsconfig.json file isn't making it through tsx to esbuild? That would need to be fixed by tsx.

@privatenumber
Copy link
Contributor

Confirming it's an issue with tsx. Sorry about the oversight.

@evanw
Copy link
Owner

evanw commented Nov 17, 2023

No problem!

@evanw evanw closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2023
@RobertAKARobin
Copy link

RobertAKARobin commented Dec 29, 2023

@privatenumber How did you end up resolving this?

Edit: Ah, I see you're the creator of TSX and it's on the roadmap. @darcyrush Did you find a workaround?

Further edit: Never mind, here's the relevant discussion: privatenumber/tsx#393 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants