Illegal constructor error when trying to use Storage in app.module.ts

I just upgraded my Ionic app (3.9.1 & Angular 5). I’m getting an “illegal” constructor error because I’m trying to use storage with angular-jwt in app.module.

Is there another way of doing this? I need to make sure that tokenGetter retrieves the token so that it is sent along with every HTTP request.


export function jwtOptionsFactory(storage) {
  return {
    tokenGetter: () => {
      return storage.get('token');
    whitelistedDomains: ['localhost:8080']

  imports: [
    IonicModule.forRoot(MyApp, {
      jwtOptionsProvider: {
        provide: JWT_OPTIONS,
        useFactory: jwtOptionsFactory,
        deps: [Storage] // Storage is a dependancy 

  providers: [
  Storage // I need to use Storage so I have to add it as a provider