【发布时间】:2016-09-20 22:25:04
【问题描述】:
我收到了404 GET /traceur,但我无话可说。我把它贴在 GIT 上,以防有人想看。
systemjs.config.js
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './main.ts',
defaultExtension: 'ts'
},
rxjs: {
defaultExtension: 'js'
},
'angular2-in-memory-web-api': {
main: './index.js',
defaultExtension: 'js'
}
}
});
})(this);
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"outDir": "build"
},
"exclude": [
"app/node_modules",
"typings/main",
"typings/main.d.ts"
]
}
您可以看到 outDir 正在构建,并且查看 SOF 这个错误意味着无法加载某些内容。但是它并没有告诉我什么无法加载,所以我迷路了。我是否需要更多配置,因为我使用的是outDir。
【问题讨论】:
-
404 traceur 错误通常是由于缺少导入,或者您的某个类中的导入错误。你可以查看这个问题的答案:stackoverflow.com/questions/37022526/…它可能会对你有所帮助。
-
你能把
map obj中的app: 'app',改成app: 'build',吗? -
谢谢@micronyks 我必须这样做然后更改
packages main: to main.js并且它正在工作。现在我再次收到Can't resolve all parameters for TypeDecorator错误。猜猜回到绘图板上。 -
如果你认为它解决了你的问题,我会把它作为未来读者的答案,如果不是这样的话。你说什么?
-
我认为对于
TypeDecorator error,您可能会提出一个新问题,因为我认为它与其他问题有关。需要检查更多和关注的代码。
标签: angular