Baahubali
Baahubali

Reputation: 4802

Angular App Empty Page in IE but works in Chrome

I have started learning Angular 4 and wrote a default application using Angular CLI (NG New HelloWorld). When i write ng serve, and browse to http://localhost:4200/, the page loads fine in Chrome, However in IE-Edge, it opens up as an empty page. there is an error in the console window of IE which is SCRIPT5022: Exception thrown and not caught File: polyfills.bundle.js, Line: 859, Column: 36. Is this expected?

Screenshot of Empty Page in Internet Explorer

Internet Explorer = Edge

Screenshot of How it loads in Chrome

Chrome

Upvotes: 17

Views: 18705

Answers (4)

Baahubali
Baahubali

Reputation: 4802

Found my answer here: Angular4 Application running issues in IE11.

Go to polyfills.ts file under the src/ folder and then as per the instructions in that file, uncomment (or add if there aren't these lines) the following lines:

/** 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';

Final notes

For the newer versions of core-js you need to change the import from '…/es6/…' to '…/es/…' (example: import 'core-js/es/symbol';).

Upvotes: 13

Sai Ganesh
Sai Ganesh

Reputation: 61

step 1:

Include or uncomment the below lines in pollyfills.ts below which is under src folder


> import 'classlist.js';  import 'web-animations-js'; (window as
> any).__Zone_enable_cross_context_check = true; import
> 'zone.js/dist/zone';

Step 2:

Run `npm install --save classlist.js`. 
Run `npm install --save web-animations-js`.

Step 3:change the value of target from es2015 to es5 in your tsconfig.json file as below

"target": "es5",

Step 4:

Restart your application by doing ng serve

Upvotes: 5

Arunkumar Chinthapalli
Arunkumar Chinthapalli

Reputation: 351

I'm running angular 8 application in windows 10 with IE11.

I tried many solutions from stackoverflow. But didn't worked anything. then i tried same solutions separately, then i got to one conclusion.

This is my final solution. i don't for howmany people it will work. but for me it worked.

1. tsconfig.json

"target": "es2015"

changed to

"target": "es5"

2. Restart your applications. this Mandatory.

Upvotes: 22

Nuttertools
Nuttertools

Reputation: 120

what is your ie version.

at official site it's only support 9,10,11

see more : https://angular.io/guide/browser-support

Upvotes: 1

Related Questions