Search code examples
javascriptangulartypescriptinternet-explorer-11polyfills

Invalid argument when running Angular 5 app on IE11


My Angular 5 app works fine when I publish and run the PROD build using Chrome, however, I keep getting the Invalid argument error when I run the app on IE11. The error message gives no indication on where/cause of the error.

Any ideas on how to resolve this issue?

** I'm using the Angular coreUI template.

Error displayed in IE11 console window

Update

As per @Melchia, i updated the polyfills and generated a new build. When I run the app on IE i see the following errors on the console and the page does not load.

Error on console


Solution

  • You need to install polyfills in order to run your application in IE. Go to src/polyfills.ts and replace its content with the following:

    import 'core-js/client/shim';
    import 'core-js/es6/symbol';
    import 'core-js/es6/object';
    import 'core-js/es6/function';
    import 'core-js/es6/parse-int';
    import 'core-js/es6/parse-float';
    import 'core-js/es6/number';
    import 'core-js/es6/math';
    import 'core-js/es6/string';
    import 'core-js/es6/date';
    import 'core-js/es6/array';
    import 'core-js/es6/regexp';
    import 'core-js/es6/map';
    import 'core-js/es6/weak-map';
    import 'core-js/es6/set';
    import 'classlist.js';  
    import 'core-js/es6/reflect';
    import 'core-js/es7/reflect';
    import 'web-animations-js';  
    import 'zone.js/dist/zone'; 
    

    Then run the following commands:

    $ npm install --save classlist.js
    $ npm install --save web-animations-js
    

    For more information about Angular browser support you can check the official documentation