Having trouble with this error - anyone know why?
[Nest] 556 - 2020-06-10 18:52:55 [ExceptionHandler] Nest can't resolve dependencies of the JwtService (?). Check that JWT_MODULE_OPTIONS at index [0] is available in the JwtModule context.
Possible fixes:
- Ensure JWT_MODULE_OPTIONS is a provider within JwtModule
- If JWT_MODULE_OPTIONS is exported from another @Module, make sure it's imported within JwtModule
@Module({
imports: [ /* Module containing JWT_MODULE_OPTIONS */ ]
})
Here are my modules:
@Module({
imports: [
PassportModule.register({ defaultStrategy: 'jwt'}),
JwtModule.register({
secret: 'topSecret51',
signOptions: {
expiresIn: 3600
},
}),
TypeOrmModule.forFeature([User])
],
controllers: [AuthController],
providers: [AuthService, UserService]
})
export class AuthModule {}
@Module({
controllers: [UserController],
providers: [UserService, AuthService],
imports: [AuthModule]
})
export class UserModule {}
@Module({
imports: [
TypeOrmModule.forRoot(typeOrmConfig),
UserModule,
AuthModule
],
})
export class AppModule {}
I've tried making changes in all modules but still having issues with my app running
Thanks for any assistance!
////////////////////////////////////////////////////