-
Notifications
You must be signed in to change notification settings - Fork 364
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
Add IE11 polyfills #154
Add IE11 polyfills #154
Conversation
Great, a fix to IE11 polyfills! Now that it is in master, can we get a new version of auth0 built & packaged with this fix? |
@keithrz next week 🎉 |
import 'core-js/es/array/from'; | ||
import 'core-js/es/typed-array/slice'; | ||
import 'core-js/es/array/includes'; | ||
import 'core-js/es/promise'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried with the fixes in this PR, but was receiving this error in auth0-spa-js:
Zone.js has detected that ZoneAwarePromise
(window|global).Promise
has been overwritten. Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)
Removing this line "import 'core-js/es/promise';" fixed the issue. The issue seems to be that Angular is already handling this polyfill and auth0 loading it again causes a conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure to import zonejs after our client: angular/angular#11650 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm tracking this PR here: zloirock/core-js#608
if they don't get it fixed in a reasonable time frame, I'll fix it in another way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luisrudge Thank you for looking into this. 🙂 I am importing core-js before zone.js as it is default in Angular 7. I'm not sure how to import zone.js after the Auth0 client, as zone.js is imported in the polyfills.ts file whereas Auth0 is imported in a component.
This might be reproducible with a vanilla Angular app (with all IE11 polyfills enabled) and basic Auth0 setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on zloirock's response, it seems like core-js-pure would be the ticket:
https://github.com/zloirock/core-js#babelruntime
Either that, or Ponyfill 😄 https://github.com/sindresorhus/ponyfill
Description
legacy.ts
file and.legacy.js
bundle file. All bundles will be IE11 compatible, so there's no need to have a separate bundle with polyfillsqs
byqss
(saves 3kb gzipped)Set
so we don't have to polyfill it (it's a big polyfill)References
Fix #113
Testing