angular: Traceur not found : XHR (404 not found) error.
[x] bug report
Current behavior On migration from _rc5 I got this :
zone.js:101 GET http://localhost:3000/traceur 404 (Not Found)scheduleTask @ zone.js:101ZoneDelegate.scheduleTask @ zone.js:345Zone.scheduleMacroTask @ zone.js:282(anonymous function) @ zone.js:122send @ VM526:3fetchTextFromURL @ system.src.js:1156(anonymous function) @ system.src.js:1739ZoneAwarePromise @ zone.js:607(anonymous function) @ system.src.js:1738(anonymous function) @ system.src.js:2764(anonymous function) @ system.src.js:3338(anonymous function) @ system.src.js:3605(anonymous function) @ system.src.js:3990(anonymous function)
![screen shot 2016-09-05 at 18 14 38]
@ system.src.js:4453(anonymous function) @ system.src.js:4705(anonymous function) @ system.src.js:408ZoneDelegate.invoke @ zone.js:332Zone.run @ zone.js:225(anonymous function) @ zone.js:591ZoneDelegate.invokeTask @ zone.js:365Zone.runTask @ zone.js:265drainMicroTaskQueue @ zone.js:497ZoneTask.invoke @ zone.js:437
(index):30 Error: Error: XHR error (404 Not Found) loading http://localhost:3000/traceur(…)(anonymous function) @ (index):30ZoneDelegate.invoke @ zone.js:332Zone.run @ zone.js:225(anonymous function) @ zone.js:591ZoneDelegate.invokeTask @ zone.js:365Zone.runTask @ zone.js:265drainMicroTaskQueue @ zone.js:497ZoneTask.invoke @ zone.js:437
66system.src.js:373 Assertion failed: loading or loaded
(https://cloud.githubusercontent.com/assets/4455130/18254447/c88a3950-7395-11e6-8654-8f7e87a0e99d.png) Expected/desired behavior To find main.js. There is absolutely no problem with the path, there are no multiline comments or additional third parties. I had no problems updating _rc5, but this hit me by a surprise.
Reproduction of the problem On npm start after the migration and solving all the errors from tsc I am unable to run the app as it comes up with some low level errors.
I realise it might not be for here, but I am stuck for a whole day on this.
- Angular version: 2.0.0-rc.5 migration to -rc.6
- Browser: [all]
- Language: [TypeScript “^1.8.10”]
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 6
- Comments: 40 (11 by maintainers)
0 down vote There are multiple reason behind this error,
1)Sometimes comments mentioned on top of app.component.ts file 2)pointing to incorrect umd file 3)If you are using ts(Transcript) version, please mention the transpiler options in config.js file as below or compile your all .ts file to .js file using transpiler and then reference .js file in code:
(function (global) { System.config({ transpiler: ‘ts’, typescriptOptions: { tsconfig: true }, 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’, ‘angular-in-memory-web-api’: ‘npm:angular-in-memory-web-api’, ‘angular2’ : ‘’ }, // packages tells the System loader how to load when no filename and/or no extension packages: { app: { main: ‘./main’, defaultExtension: ‘ts’ }, rxjs: { defaultExtension: ‘js’ }, ‘angular-in-memory-web-api’: { main: ‘./index.js’, defaultExtension: ‘js’ } } }); })(this);
Map your
@angular
modules to grab the.umd.js
version of the build, as in: https://github.com/angular/quickstart/blob/master/systemjs.config.jsI got this working by changing my tsconfig. initially I had
"compilerOptions": { "target": "es5", "module": "es6", "moduleResolution": "node", "sourceMap": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types" ], "types": [ "core-js" ], "listFiles": true }
but then I changed it to
"compilerOptions": { "target": "es5", "module": "commonjs", "moduleResolution": "node", "sourceMap": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types" ], "types": [ "core-js" ], "listFiles": true
}``notice the “module” option is the change. You cannot have module es6 and target es5.
What helped me out was getting the stack trace into the console by not catching the error when loading systemjs
System.import(‘app’);
will allow for more information than
System.import(‘app’).catch(function(err){ console.error(err); });
some mentioned doing the above in another thread about this error and it gave me alot more information to work with.
Hope this helps. I spent hours.
@vanrado you’re pulling the deps from
src
, it should be frombundles
. Thesrc
folder is probably ines2015
, that’s why traceur is being pulled.Here’s the breaking change, by the way: https://github.com/angular/angular/blob/master/CHANGELOG.md#breaking-changes (the first one)
I solved my issue. Below the traceur error I had an error claiming it also can’t require the @angular/router package. I had to change the systemjs.config.js to point to the umd.js file instead of the index.js. I hope it makes sense to some of you.