Hello, I got this error after adding the fowardRef to my modules, any ideas on how to solve?
Error: Nest can't resolve dependencies of the OrderService (OrderRepository, AttachmentRepository, ApproverService, ?). Please make sure that the argument dependency at index [3] is available in the OrderModule context.
Potential solutions:
- Is OrderModule a valid NestJS module?
- If dependency is a provider, is it part of the current OrderModule?
- If dependency is exported from a separate @Module, is that module imported within OrderModule?
@Module({
imports: [ /* the Module containing dependency */ ]
})
Order Module
@Module({
imports: [
TypeOrmModule.forFeature([Order, Attachment]),
ApproverModule,
forwardRef(() => ApprovementModule),
],
controllers: [OrderController],
providers: [OrderService],
exports: [OrderService],
})
Approvement Module
@Module({
imports: [
TypeOrmModule.forFeature([Approvement]),
forwardRef(() => OrderModule),
],
controllers: [ApprovementController],
providers: [ApprovementService],
exports: [ApprovementService],
})