Angular 2 Release (2.0.1) Internet Explorer (SystemJS) Syntax Error

て烟熏妆下的殇ゞ 提交于 2019-12-12 12:42:35

问题


I have an Angular 2 Release (2.0.1) application that works fine in Chrome but throws the following error in 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"
   }

my index.html has:

<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>

I have seen a couple suggestions and posts about different IE shims, but they are for older versions of Angular 2.

Any suggestions?


回答1:


This is the order of pre-reqs I use for my Angular2 2.4.5 app
(also worked with previous version of 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)


来源:https://stackoverflow.com/questions/41578928/angular-2-release-2-0-1-internet-explorer-systemjs-syntax-error

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