IE11中Angular4应用程序运行问题

IE11中Angular4应用程序运行问题,angular,internet-explorer,angular-cli,compatibility,polyfills,Angular,Internet Explorer,Angular Cli,Compatibility,Polyfills,我正在使用AngularCLI(1.1.2)构建Angular4项目。它在Chrome(版本59.0.3071.115)和firefox(版本54.0.1)中运行得非常好,但是当我尝试使用IE11(Verison 11.0.9600.18738)时,什么都没有显示,当我在IE中打开develper模式时,它显示了以下错误: SCRIPT5022: Exception thrown and not caught File: polyfills.bundle.js, Line: 829, Colum

我正在使用AngularCLI(1.1.2)构建Angular4项目。它在Chrome(版本59.0.3071.115)和firefox(版本54.0.1)中运行得非常好,但是当我尝试使用IE11(Verison 11.0.9600.18738)时,什么都没有显示,当我在IE中打开develper模式时,它显示了以下错误:

SCRIPT5022: Exception thrown and not caught
File: polyfills.bundle.js, Line: 829, Column: 34
详细的错误信息如下:

有人知道如何解决这个问题吗


谢谢

默认的polyfills.ts文件被注释,需要取消注释代码行并运行npm安装相应的模块。然后它将与IE11兼容,为@Zeqing的答案添加更多细节

我在
\my app\src\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/set';

我在尝试添加es7导入时得到了这个消息。我只是用es7导入替换了es6导入。结果我两者都需要

给我“引发异常但未捕获”错误:

工作正常:

import 'core-js/es6/array';
import 'core-js/es7/array';

src/polyfills.ts谢谢!当我在VS 2017中添加Angular CLI模板应用程序时,我刚刚发现我需要取消对polyfills.ts中代码行的注释,这对我来说很有用。您可能导入的内容超出了您的需要,并使包的大小膨胀。截至2018年3月,一个新的cli项目将在IE11上正常运行,除了
es6/string
es6/array
之外,所有这些都将被注释掉。该文件是。\my app\src\polyfills.tsSuper非常有用。谢谢:)对不起,为了使它与IE11兼容,应该安装哪些模块?@dmitry\u bond无论您需要哪个模块。如果您使用
[1,2,3].includes(3)
例如,
.includes
将在IE11中爆炸,直到您取消注释
核心js/es6/array
。如果您不使用任何es6功能,则不需要包含任何es6功能,您的应用程序仍将与IE11兼容。
import 'core-js/es6/array';
import 'core-js/es7/array';