Description
I have a use-case, where an app is loading [email protected]
which patches Promise
in the browser. So, even if the browser natively supports Promise.allSettled
. zone.js
patches it by removing the support. So, the embed app tries to load it's own polyfill using core-js
. I see, recently there is an issue reported that loading core.js
along side with zone.js
is breaking #953. And it's been fixed 9125de6 and released in 3.15
https://github.com/zloirock/core-js/releases/tag/v3.15.2.
Well, the fix seems to work only when the package is imported via core-js
and not using core-js-pure
. Here is an example reproduction. I am using a older version of zone.js in the example so it patches Promise
and makes allSettled
undefined.
import "zone.js";
import "core-js/modules/es.promise.all-settled";
console.log(Promise.toString());
console.log(Promise.allSettled);
console.log(window["__core-js_shared__"].versions);
https://codesandbox.io/p/devbox/8dv8tz?file=%2Fsrc%2Fmain.ts%3A6%2C49
import "zone.js";
import "core-js-pure/stable/promise/all-settled";
console.log(Promise.toString());
console.log(Promise.allSettled);
console.log(window["__core-js_shared__"].versions);
https://codesandbox.io/p/devbox/bitter-sunset-forked-h9q5fg?workspaceId=ws_UbAu3TZnxbmnTtM7Ec3eoR
I looked into fixing the same, but seems the project structure changed quite a bit under core-js-pure
and the plans for next. let me know how can i help.
Activity