having some problems, di/circular-references I'm sure I'm doing wrong, I just can't see it.
Any help would be much appreciated
user.module.ts
@Module({
imports: [
TypeOrmModule.forFeature([User]),
forwardRef(() => AuthModule)
],
providers: [ UserService, TokenService ],
exports: [ UserService ]
})
export class UserModule {}
auth.module.ts
@Module({
imports: [ forwardRef(() => UserModule) ],
controllers: [ AuthController ],
providers: [
AuthService,
UserService,
TokenService
],
exports: [ AuthService, TokenService ]
})
export class AuthModule {}
app.module.ts
@Module({
imports: [
TypeOrmModule.forRoot(),
forwardRef(() => UserModule),
forwardRef(() => AuthModule),
],
})
export class AppModule {}
I get [ExceptionHandler] Cannot read property 'module' of undefined.
Was originally having "Nest can't resolve dependencies of the UserService. I then deleted the UserModule entirely and just used the AuthModule, everything worked, then decided to add the UserModule back in today and move the code from AuthModule back into the UserModule, then discovered the forwardRef(() => ) and now I'm getting the cannot read property 'model'.
Thanks in advance
import
s part of your code? – HackneyedUserService
is defined in theAuthModule
? – Incise