I have my app.module that imports UserModule and AuthModule.
@Module({
imports: [UserModule, AuthModule],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
This is how my AuthModule looks:
@Module({
imports: [forwardRef(() => UserModule)],
controllers: [AuthController],
providers: [AuthService, UserService],
exports: [AuthModule],
})
export class AuthModule {}
And UserModule:
@Module({
imports: [TypeOrmModule.forFeature([User])],
controllers: [UserController],
providers: [UserService],
})
export class UserModule {}
I inject userService in AuthService. If i delete AuthModule from AppModule, the dependency disapears, so, the problem is maybe somewhere there.
UserServiceinAuthServicewhy did you not export it?exports: [UserService](inUserModule)