Polyfilling Promise.allSettled does not work on Edge 18
See original GitHub issueDescribe the bug
I am polyfilling Promise.allSettled
via core-js
and everything is working fine on Chrome and Firefox. However, when I open my webapp on Microsoft Edge, I get an error stating that allSettled
is not defined:
Object doesn't support property or method 'allSettled'
Honestly I am not even sure if this should be filed here or under the core-js
repository, in case it does not belong here I will move the issue there.
Did you try recovering your dependencies?
Yarn version:
β yarn --version
1.17.3
Which terms did you search for in User Guide?
I checked the guide for polyfills, and I am polyfilling like this in my app:
polyfills.js
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
import 'core-js/features/promise/all-settled';
index.js
import './polyfills';
import React from 'react';
import ReactDOM from 'react-dom';
//...
Environment
β npx create-react-app --info
npx: installed 91 in 11.825s
Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
Binaries:
Node: 11.7.0 - ~/.nvm/versions/node/v11.7.0/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.5.0 - ~/.nvm/versions/node/v11.7.0/bin/npm
Browsers:
Chrome: 75.0.3770.142
Firefox: Not Found
Safari: 12.1.2
npmPackages:
react: ^16.8.6 => 16.8.6
react-dom: ^16.8.6 => 16.8.6
react-scripts: 3.0.1 => 3.0.1
npmGlobalPackages:
create-react-app: Not Found
core-js
version:
β yarn list --pattern core-js
yarn list v1.17.3
warning Resolution field "prop-types@15.7.2" is incompatible with requested version
"prop-types@~15.6.0"
ββ babel-runtime@6.26.0
β ββ core-js@2.6.3
ββ core-js-compat@3.1.4
ββ core-js-pure@3.1.4
ββ core-js@3.1.4
ββ fbjs@0.8.17
β ββ core-js@1.2.7
ββ react-app-polyfill@1.0.1
β ββ core-js@3.0.1
ββ recharts@1.4.3
β ββ core-js@2.5.7
ββ wait-on@3.2.0
ββ core-js@2.6.9
react-app-polyfill
version:
β yarn list --pattern react-app-polyfill
yarn list v1.17.3
warning Resolution field "prop-types@15.7.2" is incompatible with requested version "prop-types@~15.6.0"
ββ react-app-polyfill@1.0.1
β¨ Done in 0.96s.
Steps to reproduce
- Install the latest
core-js
- Polyfill
Promise.allSettled
from'core-js/features/promise/all-settled'
; - Try to call
Promise.allSettled
in Edge
Expected behavior
Promise.allSettled
should be polyfilled (output below from Chrome):
Object.getOwnPropertyNames(Promise)
(8)Β ["length", "name", "prototype", "all", "race", "resolve", "reject", "allSettled"]
Actual behavior
Promise.allSettled
is not polyfilled (output below from Edge):
Object.getOwnPropertyNames(Promise)
(8)Β ["prototype", "name", "reject", "resolve", "all", "race", "length"]
Reproducible demo
I could provide a repro repository if needed.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Promise.allSettled in babel ES6 implementation - Stack Overflow
function allSettled (promises) { let wrappedPromises = promises.map(p => Promise.resolve(p) .then( ... What you need to do is to make babel polyfill Promise....
Read more >Promise.allSettled() - JavaScript - MDN Web Docs
If the iterable passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled.
Read more >JavaScript built-in: Promise: `allSettled()` - CanIUse
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop ... JavaScript built-in: Promise: allSettled().
Read more >Promise.allSettled Polyfill - JSFiddle - Code Playground
The fiddle listings (Public, Private, Titled, etc) will now display latest versions instead of the ones saved as Base versions - this was...
Read more >Polyfill for Promise.allSettled - Medium
all was it will fail even if one promise is rejected (not really a problem, more like depends on your use case) and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue here, but with IE11 (so Iβm sure itβs the same in Edge 18). Could this have something to do with the compat data? When I look in the debugger I donβt even see the file been bundled in
If this is still an issue in the current version of Edge please open a new issue.