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
{{ message }}
Repository navigation
Conflict with using "await" keyword in function argument position inside condition #190
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.
Per #795 (comment), have added a regression test for this in #795 so can confirm that that PR will fix this issue too.
[This issue] was different from the other async-to-promises issues in that it wasn't a correctness issue but an actual Babel plugin error, and per OP [h]ere, potentially due to interaction with other plugins in TSDX
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.
The repro also doesn't pass strict type-checking (the code can be plain JS) and without an export or some usage it gets tree-shaked out. I added export to it and turned off strict and didn't get an error. Also tried adding some usage to it instead and similarly didn't get an error.
@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
Or @Syynth if you have a current repro of this, that would be helpful for regression testing.
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 😕
Activity
jaredpalmer commentedon Sep 11, 2020
agilgur5 commentedon Sep 18, 2020
Per #795 (comment), have added a regression test for this in #795 so can confirm that that PR will fix this issue too.
agilgur5 commentedon Sep 20, 2020
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.
The repro also doesn't pass strict type-checking (the code can be plain JS) and without an
exportor some usage it gets tree-shaked out. I addedexportto it and turned offstrictand didn't get an error. Also tried adding some usage to it instead and similarly didn't get an error.@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
Or @Syynth if you have a current repro of this, that would be helpful for regression testing.
agilgur5 commentedon Sep 20, 2020
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 😕