-
Notifications
You must be signed in to change notification settings - Fork 507
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
Conflict with using "await" keyword in function argument position inside condition #190
Comments
This comment has been minimized.
This comment has been minimized.
Per #795 (comment), have added a regression test for this in #795 so can confirm that that PR will fix this issue too.
|
So a similar "error, not correctness" bug was found in #869 just now, so I actually reproduced that and confirmed it as an upstream issue. So I thought this is also an upstream issue, however, I was unable to reproduce this given the code from OP with TSDX v0.13.3. So perhaps changes in other Babel plugins or the ordering or ones included have already resolved this. This report is from TSDX v0.9.0, so it's quite outdated now. @jaredpalmer since you said you "might have" you hit this, could you please provide a reproduction? Your previous comment did not give any sort of example or error code. Otherwise I think this is already resolved without #795 |
Just tried this on TSDX v0.9.0 and TS 3.5.3 as per OP's environment and similarly was not able to reproduce... So even on the same version this repro doesn't seem to work 😕 |
Current Behavior
Certain usages of await keyword break babel plugin. Here is the minimum repro I could come up with:
which results in the following error:
It happens in https://github.com/babel/babel/blob/master/packages/babel-traverse/src/path/lib/virtual-types.js#L153
after being called from https://github.com/rpetrich/babel-plugin-transform-async-to-promises/blob/master/async-to-promises.ts#L3217
This may be a bug in the babel plugin but it seems to be only caused when used in conjunction with some other plugin in the tsdx babel configuration.
Expected behavior
It should compile the code correctly, as shown in this Babel Repl
Suggestions
I don't know if this is an issue with the plugin itself, in which case it would be ideal to get it fixed there, but in the mean time either the combinations of plugins which causes this would hopefully be identified or a different plugin for transforming async calls could be used.
Your environment
The text was updated successfully, but these errors were encountered: