Skip to content

Does core-js/stable include Promise.allSettled? #793

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

Closed
Mrman opened this issue Mar 31, 2020 · 2 comments
Closed

Does core-js/stable include Promise.allSettled? #793

Mrman opened this issue Mar 31, 2020 · 2 comments

Comments

@Mrman
Copy link

Mrman commented Mar 31, 2020

Hi there, trying to understand a little more of core-js. I need to polyfill to Promise.allSettled for Edge.

I see allSettled was recognized as stable in v3.2.0 of core-js (Release notes: "Promise.allSettled moved to stable ES, per July TC39 meeting"). Am I interpreting that correctly to mean it should be there when I import "core-js/stable"?

I've tested with a new brand new app using create-react-app and see Promise.allSettled as undefined in Microsoft Edge 44.18362.449.0.

Browserlist from package.json is:

"development": [
            ">0.2%",
            "not dead",
            "not ie <= 11",
            "not op_mini all",
            "edge > 1"
    ]

I see it does get polyfilled correctly if I just import "core-js"

What am I overlooking?

Thanks :)

@Mrman Mrman changed the title does core-js/stable include Promise.allSettled? Does core-js/stable include Promise.allSettled? Mar 31, 2020
@erikt9
Copy link

erikt9 commented Apr 3, 2020

I had this problem too. What you need to do is in your @babel/env configuration you need to specify corejs of 3.2 or higher (the examples and docs all just show using 3 😝 so it's difficult to know this). https://babeljs.io/docs/en/babel-preset-env

@Mrman
Copy link
Author

Mrman commented Apr 5, 2020

Thanks @erikt9. That appears to be the issue, CRA uses just major version 3 in the configuration and it isn't possible to change without ejecting. I created an issue there: facebook/create-react-app#8779

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants