-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Plugin dev] AwaitExpression not found since @babel/preset-env@7.7.7 #11940
Comments
Hey @cyrilgandon! 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." |
The behaviour is expected. Because As a workaround, you can initiate a sub-travese from module.exports = function(babel) {
console.log('Plugin read...');
return {
visitor: {
Function(path) {
path.traverse({
AwaitExpression: function() {
console.log('AwaitExpression');
}
})
}
}
};
}; However, a sub-traverse may introduces significant performance overhead so it is not recommended. Out of curiosity, what is your use case of transforming ["@babel/preset-env", { "exclude": ["@babel/plugin-transform-async-to-generators"] }] |
Use case is this plugin: https://github.com/noppa/babel-plugin-angularjs-digest-await
|
Bug Report
Current behavior
I have a plugin that worked well before, but since I upgraded to @babel/preset-env 7.11.0, it does not work anymore.
The plugin.js:
Input Code
Expected behavior
With
@babel/preset-env@7.7.6
, I got the logAwaitExpression
.With
@babel/preset-env@7.7.7+
, I have not log.Babel Configuration
.babelrc
I have narrowed down to one release, from 7.7.6 to 7.7.7.
Seeing the changes logs https://github.com/babel/babel/releases/tag/v7.7.7,
maybe it comes from #10839.
What my plugin tries to do is to run before transformations from preset on
await
call, so it can transform them.The text was updated successfully, but these errors were encountered: