1

I have created sample app with Angular 8, it works with Edge and Chrome but renders nothing in case of IE11

  1. Updated "target": "es5" in tsconfig.json

  2. Uncommented below lines in polyfill.ts and installed both packages..

import 'classlist.js'; import 'web-animations-js';

Getting below error in console for vendor.js

SCRIPT1046: Multiple definitions of a property not allowed in strict mode.

sandy
  • 438
  • 4
  • 8
  • I think that's because you use duplicate properties. There're similar threads, such as [add both styleUrls and styles to one component](https://stackoverflow.com/questions/44528605/angular-2-multiple-definitions-of-a-property-not-allowed-in-strict-mode-in-ie1), [set the same class for different evaluations](https://stackoverflow.com/questions/51505897/multiple-definitions-of-a-property-not-allowed-in-strict-mode-angular) and so on. There's also [an article](https://www.dev6.com/Multiple-Definitions-of-a-Property-Not-Allowed-in-Strict-Mode) you can refer to. – Yu Zhou Jun 17 '19 at 02:16
  • Thank you @YuZhou for your response. I am trying to run app generated by cli in IE11. I didn't update any code apart from tsconfig.json and polyfills.ts which is based on some of the articles about this issue. – sandy Jun 17 '19 at 15:49
  • I created a sample app with Angular8 and modified it according to [this post](https://github.com/angular/angular-cli/issues/14455). Then it can runs well in IE11. You can try the ways provided in it. – Yu Zhou Jun 18 '19 at 03:13
  • I have followed all the steps but still getting the same error (SCRIPT1046) in console. I am using NodeJs v10.14.2 is that a problem? – sandy Jun 18 '19 at 17:01
  • I'm using NodeJs v10.15.3. I think this shouldn't be a problem. I have met the situation that I followed all the steps but didn't work in the end. Finally I delete the app and create it again according to the steps then it works... – Yu Zhou Jun 19 '19 at 06:49
  • @YuZhou thanks. I created another app and it started working but then was wondering why it did not work earlier; so verified differences between both apps and found out Ivy was enabled in tsconfig.app.json like this "angularCompilerOptions": { "enableIvy": true } after disabling this option it started working. – sandy Jun 19 '19 at 16:33

1 Answers1

1

Follow any one option mentioned from this post and make sure you have not enabled Ivy compiler in tsconfig.app.json

"angularCompilerOptions": { "enableIvy": false }

sandy
  • 438
  • 4
  • 8