Angular 2发行版(2.0.1)Internet Explorer(SystemJS)语法错误

时间:2017-01-10 21:41:09

标签: angular systemjs

我有一个Angular 2 Release(2.0.1)应用程序,可以在Chrome中正常运行但在Internet Explorer 11中引发以下错误:

Error: (SystemJS) Syntax error
    SyntaxError: Syntax error
       at Anonymous function (eval code:11:1)
       at Anonymous function (eval code:1:31)
       at eval code (eval code:1:2)
    Evaluating http://localhost:56159/areas/dashboard/modules/app.module.js
    Evaluating http://localhost:56159/areas/dashboard/dashboard.js
    Error loading http://localhost:56159/areas/dashboard/dashboard.js
   {
      [functions]: ,
      __proto__: { },
      description: "(SystemJS) Syntax error
    SyntaxError: Syntax error
       at Anonymous function (eval code:11:1)
       at Anonymous function (eval code:1:31)
       at eval code (eval code:1:2)
    Evaluating http://localhost:56159/areas/dashboard/modules/app.module.js
    Evaluating http://localhost:56159/areas/dashboard/dashboard.js
    Error loading http://localhost:56159/areas/dashboard/dashboard.js",
      message: "(SystemJS) Syntax error
    SyntaxError: Syntax error
       at Anonymous function (eval code:11:1)
       at Anonymous function (eval code:1:31)
       at eval code (eval code:1:2)
    Evaluating http://localhost:56159/areas/dashboard/modules/app.module.js
    Evaluating http://localhost:56159/areas/dashboard/dashboard.js
    Error loading http://localhost:56159/areas/dashboard/dashboard.js",
      name: "Error",
      originalErr: { },
      stack: "(SystemJS) Syntax error
    SyntaxError: Syntax error
       at Anonymous function (eval code:11:1)
       at Anonymous function (eval code:1:31)
       at eval code (eval code:1:2)
    Evaluating http://localhost:56159/areas/dashboard/modules/app.module.js
    Evaluating http://localhost:56159/areas/dashboard/dashboard.js
    Error loading http://localhost:56159/areas/dashboard/dashboard.js"
   }

我的index.html有:

<script src="./node_modules/core-js/client/shim.min.js"></script>
<script src="./node_modules/zone.js/dist/zone.js"></script>
<script src="./node_modules/reflect-metadata/Reflect.js"></script>
<script src="./node_modules/systemjs/dist/system.src.js"></script>

我已经看到了一些关于不同IE填充程序的建议和帖子,但它们适用于Angular 2的旧版本。

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

这是我用于Angular2 2.4.5 app的预先请求的顺序 (也适用于以前版本的Angular2):

node_modules/core-js/client/core.min.js (version 2.4.1)      
node_modules/reflect-metadata/Reflect.js (version 0.1.9)
node_modules/systemjs/dist/system.src.js (version 0.19.42)
node_modules/zone.js/dist/zone.js (version 0.7.6)