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
How to resolve the warning when use @babel/plugin-transform-typescript to compile typescript #10264
Comments
Hey @kingller! 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. |
Hi, @kingller! That warning was introduced in Babel 7.5.2 and signals some incompatibility between Babel and the plugins. I'm guessing one of the plugins you used is injecting a variable declaration without adding it to the scope, but I can't pinpoint which one. I have written a small TS program and transformed it with your config files, but I couldn't reproduce the issue. It is maybe caused by something in your program that triggers the faulty plugin to inject the variable. Can you provide a minimal program that reproduces this warning? |
Hi,@thiagoarrais
When I give it a name (such as
It's OK. |
It's potentially a problem with the plugin. I will dig into that. Thanks for the report! |
May be it can help a bit. I had warnings when there were default exports in my ts(x) files and I imported it in my js(x) files.
|
It seems like we have injected an identifier without declaring binding in the scope.
Related similar PR: #10172 |
similar problem: transform[stderr]: This problem is likely caused by another plugin injecting |
Same here getting
|
is there an easy way to find which plugin is causing this? |
I haven't tested it yet but the last comment of this PR should work i guess |
Since the AST is fully mutable we can't track automatically which plugin is inserting a new node, but you can try to understand which transformation that identifier comes from (was that originally a class? an export declaration?) |
For compatibility with the Typescript plugin Fixes babel#10264
OK. Thanks. |
* Decorators legacy: register inserted declaration For compatibility with the Typescript plugin Fixes #10264 * Register declaration but also keep replaceWithMultiple
@listenzz if you are upgrading the latest version of RN, you can try to change the |
This is still happening for us using |
Hi,
When I use
@babel/plugin-transform-typescript
to compile typescript, the warning happensI cannot find out why.
Here is my
babel.config.js
And part of my
webpack.config.js
And the program works OK. When I use
ts-loader
instead, it's OK too.Can you help me? Thanks.
The text was updated successfully, but these errors were encountered: