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