I encounter this error when executing the project :
[Nest] 22613 - 07/25/2021, 4:34:24 PM LOG [InstanceLoader] EventStoreModule dependencies initialized +1ms
[Nest] 22613 - 07/25/2021, 4:34:24 PM ERROR [ExceptionHandler] Nest can't resolve dependencies of the CommandBus (?). Please make sure that the argument ModuleRef at index [0] is available in the CqrsModule context.
Potential solutions:
- If ModuleRef is a provider, is it part of the current CqrsModule?
- If ModuleRef is exported from a separate @Module, is that module imported within CqrsModule?
@Module({
imports: [ /* the Module containing ModuleRef */ ]
})
Error: Nest can't resolve dependencies of the CommandBus (?). Please make sure that the argument ModuleRef at index [0] is available in the CqrsModule context.
Potential solutions:
- If ModuleRef is a provider, is it part of the current CqrsModule?
- If ModuleRef is exported from a separate @Module, is that module imported within CqrsModule?
@Module({
imports: [ /* the Module containing ModuleRef */ ]
})
at Injector.lookupComponentInParentModules (/home/pedram/my-project/github-samples/nestjs-cqrs-starter/node_modules/@nestjs/core/injector/injector.js:189:19)
at Injector.resolveComponentInstance (/home/pedram/my-project/github-samples/nestjs-cqrs-starter/node_modules/@nestjs/core/injector/injector.js:145:33)
at resolveParam (/home/pedram/my-project/github-samples/nestjs-cqrs-starter/node_modules/@nestjs/core/injector/injector.js:99:38)
at async Promise.all (index 0)
at Injector.resolveConstructorParams (/home/pedram/my-project/github-samples/nestjs-cqrs-starter/node_modules/@nestjs/core/injector/injector.js:114:27)
at Injector.loadInstance (/home/pedram/my-project/github-samples/nestjs-cqrs-starter/node_modules/@nestjs/core/injector/injector.js:47:9)
at Injector.loadProvider (/home/pedram/my-project/github-samples/nestjs-cqrs-starter/node_modules/@nestjs/core/injector/injector.js:69:9)
at async Promise.all (index 3)
at InstanceLoader.createInstancesOfProviders (/home/pedram/my-project/github-samples/nestjs-cqrs-starter/node_modules/@nestjs/core/injector/instance-loader.js:44:9)
at /home/pedram/my-project/github-samples/nestjs-cqrs-starter/node_modules/@nestjs/core/injector/instance-loader.js:29:13
hello,
I encounter this error when executing the project :
package.json :
my app.module.ts :
my product.module.ts :