IE 11 compatibility errors using Angular 5

一曲冷凌霜 提交于 2019-12-05 01:34:26

问题


I have build my Angular application then run it in server.

I got errors that where not shown in localhost.

Unable to get property 'onHover' of undefined or null reference.

File Chart.min.js, ligne : 10, colonne : 115187

Error “SCRIPT 1028 Expected identifier, string or number”

File polyfills.bundle.js, ligne : 6399, colonne : 5 .

Object doesn't support property or method 'querySelector

File styles.bundle.js, ligne : 215, colonne : 2

Expected identifier

File: vendor.bundle.js, ligne : 3169, colonne : 23

I have uncommente imports in 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/weak-map';
 import 'core-js/es6/set';

//import 'classlist.js';  // Run `npm install --save classlist.js`.
import 'core-js/es7/reflect';

// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
import 'zone.js/dist/zone';  // Included with Angular CLI.

Here's network trafic when loading app


回答1:


Add meta tag in the index.html. This is also a necessary line.

<meta http-equiv="X-UA-Compatible" content="IE=edge" />


来源:https://stackoverflow.com/questions/49793662/ie-11-compatibility-errors-using-angular-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!