Angular2: object does not support this action in Microsoft Edge browser

My angular2 application throws an exception indicating Object does not support this action only in Microsoft edge. Check out the image below:

enter image description here

enter image description here

I debugged and found out that the exception throws itself at the promise, and then the code. To be more specific, I get an error with the code below:

this.dataLayerService .postLogin(this.model, this.postURL) .then(usermasterResponse => this.setToken(usermasterResponse)) .catch(error => { this.toastCommunicationService.setMessage(error, "", this.toastCommunicationService.errorType) }); 

I also added the below script in the index.html file, but that was also in vain.

 <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-shim.js"></script> 

Any help would be greatly appreciated.

Thanks in advance.

0
source share
3 answers

The problem was the EventSource in the code below:

 this.eventsource = new EventSource(this.configService.get("BaseURL")); 

I solved this by adding Source Source Polyfill js. I set the EventSource Polyfill link to install js.

Thank you all for your help.

0
source

Put <meta http-equiv="x-ua-compatible" content="ie=edge"> in your index.html And also check your script policies and import all core-js / es6 / scripts files

0
source

Locate the polyfills.ts file in the angular project folder and import 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/es7/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'; import 'core-js/es7/array'; 

If you use web animation, you need this:

 /** IE10 and IE11 requires the following to support `@angular/animation`. */ import 'web-animations-js'; // Run `npm install --save web-animations-js`. 

For evergreen browsers, your need is:

 /** Evergreen browsers require these. **/ import 'core-js/es6/reflect'; import 'core-js/es7/reflect'; 

Definition of web browsers ( original ):

The latest versions of Chrome, Firefox, Internet Explorer and Safari are evergreen browsers, i.e. they are automatically automatically updated without user request. For Internet Explorer, most people think that means IE10 +.

0
source

All Articles