I'm facing an issue with my folder structure:
.
├── lib/
│ └── dma/
│ ├── modules/
│ │ └── cmts/
│ │ ├── cmts.module.ts
│ │ └── cmts.service.ts
│ └── dma.module.ts
└── src/
├── app.module.ts
└── app.service.ts
Within this structure, I have 3 modules and 2 services. The AppService service depends on the CmtsService:
// # ~/src/app.service.ts
@Provider()
class AppService{
constructor(private readonly cmtsService: CmtsService)
}
// # ~/src/app.module.ts
@Module({
imports: [DmaModule],
})
class AppModule{}
// # ~/lib/dma/dma.module.ts
@Module({
imports: [CmtsModule],
})
class DmaModule{}
// # ~/lib/dma/modules/cmts/cmts.module.ts
@Module({
imports: [],
providers: [CmtsService]
})
class CmtsModule{}
// # ~/lib/dma/modules/cmts/cmts.service.ts
@Provider()
class CmtsService{
}
Upon running the application, I encounter the following error message:
ERROR [ExceptionHandler] Nest can't resolve dependencies of the AppService (?). Please make sure that the argument CmtsService at index [0] is available in the AppModule context.