Unable to decode jwt with jwt-decode

I think you should import it like this:

import * as jwt_decode from 'jwt-decode';

According to documentation + internet search, the correct way is:

1. Install the package + types

npm install --save jwt-decode

npm install --save @types/jwt-decode

  1. When you import the jwt_decode, you should surpass a rule from tslint, your code will look exactly like this (with commented line above)
 // @ts-ignore  
import jwt_decode from "jwt-decode";

Otherwise you will get an error like this enter image description here

You can add also the rule for that on tsconfig.json , but is 1 time exception :)