Skip to content

Getting 404 GET /angular2-token after running npm start #23

@ezilocchi

Description

@ezilocchi

After I followed all the steps in the README.md file I was still getting 404 GET /angular2-token right after I run npm start. Since I'm using system.js config instead of webpack (as the example in github) I added these lines on my systemjs.config.js file.

diff --git a/systemjs.config.js b/systemjs.config.js
index 1921a43..c6f118e 100644
--- a/systemjs.config.js
+++ b/systemjs.config.js
@@ -9,15 +9,15 @@
     'app':                        'app', // 'dist',

     '@angular':                   'node_modules/@angular',
+    'angular2-token':             'node_modules/',
   };

   // packages tells the System loader how to load when no filename and/or no extension
   var packages = {
     'app':                        { main: 'main.js',  defaultExtension: 'js' },
     'rxjs':                       { defaultExtension: 'js' },
+    'angular2-token':             { main: 'angular2-token/angular2-token', defaultExtension: 'js' }
   };

and It passed, but I got this issue

(SystemJS) Unexpected token

So I found that inside node_modules/angular2-token/angular2-token.js there was this line

__export(require('./lib/angular2-token-ui/angular2-token-ui.module'));

Once I removed it, it started working fine 😊

IMPORTANT:

  1. I didn't find when that line was set (I got the project source code)
  2. I installed the library through npm install angular2-token --save

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions