Angular2-jwt: v5.0.0+ breaks IE11 Compatibility

Created on 28 Jul 2020  路  4Comments  路  Source: auth0/angular2-jwt

Description

When using this library at v5.0.0 and after, no HTTP calls work when using the application within IE11. The changelog mentions that the "URL dependency" was removed. This is the precise item that allowed this to work in IE11. This was mentioned in the following issue: https://github.com/auth0/angular2-jwt/issues/509

Reproduction

  • Create an Angular 10+ application that uses v5 or higher of this library.
  • In .browserslistrc, add IE 11 and change bottom line to not IE 910
  • In tsconfig.base.json, change the target to es5
  • Make some sort of server call with HTTPClient
  • Observe following error:
    image

Environment

  • Version of this library used: v5.0.1
  • Version of the platform or framework used, if applicable: Angular 10.0.5
  • Other relevant versions (language, server software, OS, browser): Internet Explorer 11
  • Other modules/plugins/libraries that might be involved:

Most helpful comment

The way to temporarily fix this for IE11 is the following:

  • run npm i --save url-polyfill
  • add import 'url-polyfill'; to polyfills.ts

All 4 comments

The way to temporarily fix this for IE11 is the following:

  • run npm i --save url-polyfill
  • add import 'url-polyfill'; to polyfills.ts

I have the same thing on my mobile application that is based on Nativescript with Angular
It worked before the "URL dependency" was removed.

To solve the IE11 compatibility, adding a polyfill for url like @JaxonWright mentioned might indeed be the way to go.

  • run npm i --save url-polyfill
  • add import 'url-polyfill'; to polyfills.ts

@boris01 we'll continue the conversation about Nativescript on #675

Was this page helpful?
0 / 5 - 0 ratings