You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If use context, and try using forFeature with this context, module cannot resolve MicroORM in MikroOrmMiddleware
Stack trace
/project/node_modules/@nestjs/core/injector/injector.js:262
throw new unknown_dependencies_exception_1.UnknownDependenciesException(wrapper.name, dependencyContext, moduleRef, { id: wrapper.id });
^
Error: Nest can't resolve dependencies of the MikroOrmMiddleware (?). Please make sure that the argument MikroORM at index [0] is available in the MikroOrmCoreModule context.
Potential solutions:
- Is MikroOrmCoreModule a valid NestJS module?
- If MikroORM is a provider, is it part of the current MikroOrmCoreModule?
- If MikroORM is exported from a separate @Module, is that module imported within MikroOrmCoreModule?
@Module({
imports: [ /* the Module containing MikroORM */ ]
})
To Reproduce
Steps to reproduce the behavior:
import {microOrmConfig} from './config';
const contextName = 'default'
@Module({
imports: [MikroOrmModule.forFeature([], contextName)],
})
class Test {}
@Module({
imports: [
MikroOrmModule.forRoot({
...microOrmConfig,
contextName
}),
Posible solution
Create function which return provider for current context
Activity