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
[Bug]: failed to transform Class fields with declare
modifier in TypeScript
#16262
Comments
Hey @TechQuery! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
repl |
@liuxingbaoyu Try this history code, you will get the error. |
Unfortunately I still can't reproduce it. |
|
Oops I made a mistake, but I still can't reproduce it.🤦♂️ |
But, Real World code has Real Quirk error: https://gitpod.io/?autostart=true#https://github.com/kaiyuanshe/kaiyuanshe.github.io/pull/304 |
I can't run it locally. |
It's so weird! My reproduce project works well: https://gitpod.io/?autostart=true#https://github.com/idea2app/Babel-decorator-bug |
It works in gitpod, but I don't see the error.
|
Yes, look above, I have found this weird situation: every MVP works well, but my origin project failed with Babel error... |
Please try removing |
Same error after running: rm -rf node_modules/ pnpm-lock.yaml
pnpm i
pnpm build |
@liuxingbaoyu I upgrade another project built with the same upstream scaffold, then the same error thrown: but, another |
Now that I can reproduce it I'll take a look. |
This is a plugin order issue and as a temporary solution you can use a configuration like this.
|
💻
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
Configuration file name
No response
Configuration
Current and expected behavior
Expect this error to be fixed:
Environment
Possible solution
The
throw
logic needsnode.value
existed, but my code has no value initialization withdeclare
...babel/packages/babel-plugin-transform-typescript/src/index.ts
Lines 143 to 148 in f856fc2
Additional context
Real world code:
The text was updated successfully, but these errors were encountered: