0

I am getting 404 GET /traceur but I have nothing to go off of. I posted it on GIT in case anyone wanted to look at it.

GIT_HUB Link

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"
    ]
}

You can see the outDir is going to build and looking at SOF this error means something cannot be loaded. However it doesn't tell me what cannot be loaded so I am lost. Do I need to more configuration because I am using outDir.

Mike3355
  • 11,305
  • 24
  • 96
  • 184
  • the 404 traceur error is often due to a missing import, or a bad one in one of your classes. you can check the answers to this question: http://stackoverflow.com/questions/37022526/angular-2-404-traceur-not-found it might help you. – Supamiu Sep 20 '16 at 13:56
  • can you change `app: 'app',` in `map obj` to `app: 'build',`? – micronyks Sep 20 '16 at 13:58
  • Thank you @micronyks I had to do that then change `packages main: to main.js` and it is working. Now I am getting `Can't resolve all parameters for TypeDecorator` error again. Guess back to the drawing board. – Mike3355 Sep 20 '16 at 14:05
  • If you think it solves your problem, i'll put it as an answer for future readers, if not its okay. what you say? – micronyks Sep 20 '16 at 14:09
  • And I think for `TypeDecorator error` , you might create a new question as it is i think related to something else. Need to check more and concerned code. – micronyks Sep 20 '16 at 14:11
  • I had the same issue yesterday and I think I spoke to you. Spent all day on it and changed my project structure and got this error. Now I am back to where I started. – Mike3355 Sep 20 '16 at 14:13
  • @micronyks I posted the new question at https://stackoverflow.com/questions/39596581/error-cant-resolve-all-parameters-for-typedecorator-angular-2-rc-6 – Mike3355 Sep 20 '16 at 14:29

1 Answers1

0

This is I had to change:

 map: {
      // our app is within the app folder
      app: 'build',

      // 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.js',
        defaultExtension: 'js'
      },
      rxjs: {
        defaultExtension: 'js'
      },
      'angular2-in-memory-web-api': {
        main: './index.js',
        defaultExtension: 'js'
      }
    }

Since I was using outDir in my tsconfig.json I had to change where the js and map file are being looked for.

Also comments in ts are /** */ and not /* */, this can also cause the error.

This error means something CANNOT be loaded issue it is doesn't tell you where.

Mike3355
  • 11,305
  • 24
  • 96
  • 184