Angular2-jwt: Uncaught ReferenceError: require is not defined. No SystemJS.

Created on 27 Jun 2017  路  3Comments  路  Source: auth0/angular2-jwt

I'm creating new angular4 project from scratch using angular/cli:
ng new myproject
cd ./myproject

Then I'm installing angular2-jwt package:
npm install angular2-jwt --save

Run this project:
ng serve

Open project in browser (chrome):
http://localhost:4200

Following error appears in chrome console:
image

Note: I believe angular/cli does not use SystemJS anymore. It use webpack2 instead.

Related Info:

angular-cli version ng -v:
angular/cli: 1.1.3
node: 6.11.0
os: win32 x64

It seems that angular2-jwt module works fine, no problems except that annoying message in console. How to get rid of it?

Regards!

Most helpful comment

I'm having same issue don't know how to resolve...all help I can find is using System.js but we don't have it in Angular 4 created by the CLI

All 3 comments

Have the same issue.
But the error message began to appear after some while.

@angular/cli: 1.2.6
node: 8.2.1
os: linux x64
@angular/animations: 4.3.3
@angular/common: 4.3.3
@angular/compiler: 4.3.3
@angular/core: 4.3.3
@angular/forms: 4.3.3
@angular/http: 4.3.3
@angular/platform-browser: 4.3.3
@angular/platform-browser-dynamic: 4.3.3
@angular/router: 4.3.3
@angular/cli: 1.2.6
@angular/compiler-cli: 4.3.3
@angular/language-service: 4.3.3

I'm having same issue don't know how to resolve...all help I can find is using System.js but we don't have it in Angular 4 created by the CLI

Closing as require is no longer used in latest

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaumard picture jaumard  路  5Comments

tekkudoc picture tekkudoc  路  5Comments

ciesielskico picture ciesielskico  路  5Comments

guillaume-skwid picture guillaume-skwid  路  5Comments

Eddman picture Eddman  路  3Comments