Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular4 Application running issues in IE11

I am building a Angular4 project using Angular CLI (1.1.2). It runs perfectly in Chrome (Version 59.0.3071.115) and firefox(54.0.1) but when I tried to use IE11 (Verison 11.0.9600.18738) nothings shows up and when I open the develper mode in IE, it shows me the following Error:

SCRIPT5022: Exception thrown and not caught File: polyfills.bundle.js, Line: 829, Column: 34 

And the detailed Error message is following:

enter image description here

Anyone knows how to solve this problem?

Thanks!

like image 514
Terry Zhang Avatar asked Jul 27 '17 14:07

Terry Zhang


People also ask

Why Angular app is not working in IE?

There can be numerous reasons why your Angular application is not working, including: Missing polyfills in polyfills. ts . Using a TypeScript target version which IE11 does not support.

Is Angular compatible with IE11?

The Angular team is deprecating support for Internet Explorer 11 in Angular v12 (to be released in May 2021 and supported through November 2022), and plans to remove support for this browser in Angular v13 (late 2021).

Does Angular 13 support IE?

Google has removed IE11 support in Angular 13. In the company that I work for, we have to keep IE11 support for the next few months due to contractual obligations.


2 Answers

To add more detail to @Zeqing's answer.

I uncommented the following line of codes in .\my-app\src\polyfills.ts :

/** IE9, IE10 and IE11 requires all of the following polyfills. **/ 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/set'; 
like image 158
Chizl Avatar answered Sep 23 '22 05:09

Chizl


The default polyfills.ts file is commented and need to uncomment lines of code and run npm install the corresponding module. Then it will compatible with the IE11

like image 29
Terry Zhang Avatar answered Sep 22 '22 05:09

Terry Zhang