auth0 / auth0-spa-js

Auth0 authentication for Single Page Applications (SPA) with PKCE
MIT License
903 stars 357 forks source link

Syntax Error on IE #97

Closed izzmeifter closed 5 years ago

izzmeifter commented 5 years ago

The lib was erroring on our project in IE 11 after updating to the spa lib from lock, and when testing with the demo application we get the same error. It looks like it's using some es6 syntax in the module (spread operator). I'm using differential loading, but it doesn't look like it effects node_modules. below are the errors from the demo app.

This is on IE 11.0.9600

Perhaps i'm doing something wrong in the configuration, but i can't find anything.

Thanks.

Screen Shot 2019-07-19 at 3 47 11 PM Screen Shot 2019-07-19 at 3 56 08 PM
luisrudge commented 5 years ago

Ops! That was an oversight of my part. I opened a PR to fix the file that bundlers will pick when you import our library. I'm so sorry about this. If you need a quick replacement for this weekend, feel free to use our CDN bundle that is ES5 compatible and has all the polyfills available: https://cdn.auth0.com/js/auth0-spa-js/1.1.0/auth0-spa-js.production.legacy.js - it's a bit bigger than the original one, but will work in IE11 just fine!

keithrz commented 5 years ago

@luisrudge does auth0-spa-js.production.legacy.js add createAuth0Client to the global window object, just like auth0-spa-js.product.js does ? I don't see how it does. If not, how are you supposed to use auth0-spa-js.production.legacy.js ? (this may be a moot point if a new build was generated with the latest code from master)

luisrudge commented 5 years ago

@keithrz you're totally right. It didn't expose the object in the window 🤦‍♂ In any case, legacy is going away and we're shipping the IE11 polyfills in the main bundle in the next version that will be released next week.