You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a REPL of the large minified build where we encountered the bug. Unfortunately, while I could track down the incriminated plugins, I haven't managed to single out a smaller portion of code where the bug could be reproduced.
Current (line references based on the REPL): the class n declared at L7 and instantiated in the function Rr at L3297 of the original code is shadowed by a var declaration in the transformed code (at L5599). As a result, the instantiation fails due to n being undefined.
Expected: the var declaration uses a different name.
Not really a solution, but excluding either @babel/plugin-transform-async-to-generator or @babel/plugin-transform-regenerator fixes the issue.
Additional context
I noticed that dropping the code after the affected function (Rr) results in a correct transformation, hence something in the rest of the code must be playing a role too.
The text was updated successfully, but these errors were encountered:
Hey @larabr! 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.
I have encountered a similar issue as well. Whenever I use destructuring assignment within an asynchronous function, like const {a, b} = await request(), I encounter an error related to an undefined type. In my case, I was able to successfully build my project by excluding the @babel/plugin-transform-regenerator plugin.
馃捇
How are you using Babel?
@babel/cli
Input code
I have a REPL of the large minified build where we encountered the bug. Unfortunately, while I could track down the incriminated plugins, I haven't managed to single out a smaller portion of code where the bug could be reproduced.
REPL
Configuration file name
No response
Configuration
npx babel --plugins=@babel/plugin-transform-destructuring,@babel/plugin-transform-for-of,@babel/plugin-transform-spread,@babel/plugin-transform-classes,@babel/plugin-transform-regenerator, @babel/plugin-transform-regenerator, @babel/plugin-transform-async-to-generator
Current and expected behavior
Current (line references based on the REPL): the class
n
declared at L7 and instantiated in the functionRr
at L3297 of the original code is shadowed by a var declaration in the transformed code (at L5599). As a result, the instantiation fails due ton
being undefined.Expected: the var declaration uses a different name.
Environment
Possible solution
Not really a solution, but excluding either
@babel/plugin-transform-async-to-generator
or@babel/plugin-transform-regenerator
fixes the issue.Additional context
I noticed that dropping the code after the affected function (
Rr
) results in a correct transformation, hence something in the rest of the code must be playing a role too.The text was updated successfully, but these errors were encountered: