3

I have an Angular 7 app and when I run it in IE11 I get the error "Object.getPrototypeOf: 'this' is not an Object". This error only ocurs when I compile the app with the --prod flag and run on a http server. Below is where the error is ocurring. I've search the internet for solutions, but nothing. Does anyone have any usggestions?

enter image description here

CaptainMorgan
  • 1,193
  • 2
  • 25
  • 55

2 Answers2

0

Maybe problem in browser? Did you try to test with Chrome or Firefox?

polyfills.ts set improperly also can be a reason.

Yeheshuah
  • 1,216
  • 1
  • 13
  • 28
0

Angular issues with IE usually caused by lacking of polyfills. The easy way to uncomment polyfills is just to replace all // import with import in polyfill.ts. But core-js only provides polyfills for popular es6 features, if your code contains more code that is not supported in IE then you have to find the polyfill and import it yourself.

After that you need to install some packages with npm:

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

Finally, add the meta tag <meta http-equiv="X-UA-Compatible" content="IE=edge"> in your index.html.

Yu Zhou
  • 11,532
  • 1
  • 8
  • 22
  • Is there any other es6 syntax not supported by IE in your code? And have you imported polyfills for them? I think it could be better if you could provide a [minimal example](https://stackoverflow.com/help/minimal-reproducible-example) to reproduce the issue. – Yu Zhou Sep 04 '19 at 03:04