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
Using @babel/runtime-corejs*
still uses the global Promise for generators/async-fns
#10678
Comments
I was definitely burned on this. here is a minimal repro example. https://github.com/mreinstein/babel-async-min-example To reproduce the problem:
|
cc @benjamn What do you think that would be best to do? |
I actually have a test case that worked fine in Babel 7.6.2, but is broken with Babel 7.7.2. See also: The README Environment
IE11 complains about this |
This (at least my) problem is caused by #9481. Disabling the |
@marcelgerber / @mreinstein I want to keep the logic because it will be useful in the future for something we are working on and because I'd like to avoid using |
@nicolo-ribaudo Yes, that's exactly what I did yesterday. With these two lines commented out everything works just fine. |
Is this an application-level concern, such that setting |
@benjamn I don't know exactly what you're asking, and I think you know the correct answer better than I do. But if I understand your question correctly, then I think a global one-time-setup code would suffice. I don't see why someone would need multiple, different Promise implementations. |
From a transformer point of view, I think that it would be easier to pass it as a parameter. @marcelgerber I realize that my previous comment wasn't clear at all, but I was asking if you want to open a PR commenting out that lines 😅 |
Can confirm this is working now in v7.7.7 with #10839. |
I'll keep this issue open since I would like to reintroduce the commit we had to revert |
This should be fixe by facebook/regenerator#383, because now we use the polyfilled promise with regenerator. |
I thought this was something we'd addressed at some point, but I guess not?
regenerator-runtime
uses the globalPromise
, even if we're trying to use it via one of the standalone runtime modules like@babel/runtime-corejs3
. In an ideal world, we'd be able to pass in thePromise
implementation that the regenerator runtime should use, or else transform the regenerator runtime at publish time and include a copy of it inside the babel runtime, or something.The text was updated successfully, but these errors were encountered: