@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
load: [
serverConfigRegistration,
databaseConfigRegistration,
],
}),
MikroOrmModule.forRootAsync({
useFactory: (configService: ConfigService) => {
return mikroOrmConfigFactory({
serviceName: 'users',
entities: [Invoice],
debug: true,
}, configService)
},
inject: [ConfigService],
}),
ServiceModule,
],
controllers: [AppController],
})
export class AppModule {}
import { EntityManager } from '@mikro-orm/core';
@Injectable()
export class UserDbService {
constructor(
private readonly entityManager: EntityManager,
) {}
}
When I try to call some methods from this.entityManager
I see undefined. UserDbService
has a correct providing on AppModule. What could it be?
Versions:
"@mikro-orm/core": "^6.4.11",
"@mikro-orm/nestjs": "^6.1.1",