问题
I am attempting to setup a very basic Aurelia project in ASP.Net 5.0 RC1. I am getting the following JavaScript error after doing a basic initial setup. I am using TypeScript.
Unhandled promise rejection Error: XHR error (404 Not Found) loading http://localhost:5392/core-js.js
Error loading http://localhost:5392/core-js.js as "core-js" from http://localhost:5392/jspm_packages/npm/aurelia-loader@1.0.0-beta.1/aurelia-loader.js
at o (http://localhost:5392/jspm_packages/system.js:4:12694)
at XMLHttpRequest.s.onreadystatechange (http://localhost:5392/jspm_packages/system.js:4:13219)
(anonymous function) @ es6.promise.js:138
The setup I did is as follows.
- Create Empty ASP.Net 5.0 template.
- Install
Microsoft.AspNet.StaticFiles
from nuget and set upapp.UseFileServer
. From
git bash
runjspm init
with the following settings.Package.json file does not exist, create it? [yes]: Would you like jspm to prefix the jspm package.json properties under jspm? [yes]: Enter server baseURL (public folder path) [./]:./wwwroot Enter jspm packages folder [wwwroot\jspm_packages]: Enter config file path [wwwroot\config.js]: Configuration file wwwroot\config.js doesn't exist, create it? [yes]: Enter client baseURL (public folder URL) [/]: Do you wish to use a transpiler? [yes]: Which ES6 transpiler would you like to use, Babel, TypeScript or Traceur? [babel]:typescript
From
git bash
runjspm install aurelia-framework
andjspm install aurelia-bootstrapper
.- Add the
index.html
,app.html
, andapp.ts
file from the aurelia docs. - Fire up IIS Express, load page, get error.
Is there a step I am missing in this setup?
回答1:
It seems like this is a known issue. The fix is somewhat simple. If you add a core-js
mapping at the top of the map section in config.js
, it fixes it.
For example,
map: {
"core-js": "npm:core-js@1.2.6",
// other mappings
}
来源:https://stackoverflow.com/questions/34032054/javascript-error-in-simple-aurelia-asp-net-5-0-rc1-setup