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.
Yarn version:
โ yarn --version
1.17.3
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';
//...
โ 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 "[email protected]" is incompatible with requested version
"prop-types@~15.6.0"
โโ [email protected]
โ โโ [email protected]
โโ [email protected]
โโ [email protected]
โโ [email protected]
โโ [email protected]
โ โโ [email protected]
โโ [email protected]
โ โโ [email protected]
โโ [email protected]
โ โโ [email protected]
โโ [email protected]
โโ [email protected]
react-app-polyfill version:
โ yarn list --pattern react-app-polyfill
yarn list v1.17.3
warning Resolution field "[email protected]" is incompatible with requested version "prop-types@~15.6.0"
โโ [email protected]
โจ Done in 0.96s.
core-jsPromise.allSettled from 'core-js/features/promise/all-settled';Promise.allSettled in EdgePromise.allSettled should be polyfilled (output below from Chrome):
Object.getOwnPropertyNames(Promise)
(8)ย ["length", "name", "prototype", "all", "race", "resolve", "reject", "allSettled"]
Promise.allSettled is not polyfilled (output below from Edge):
Object.getOwnPropertyNames(Promise)
(8)ย ["prototype", "name", "reject", "resolve", "all", "race", "length"]
I could provide a repro repository if needed.
try importing 'core-js/es/promise/all-settled' instead
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
Have you tried the fix suggested by @Roybie? I did not have the chance to try this yet.
@simonedavico I actually did that initially and it didn't work...ended up just polyfilling it myself
Most helpful comment
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