ArkerLabs / event-sourcing-nestjs

NestJS module for implementing Event Sourcing
224 stars 47 forks source link

Error with NestJS v9: Error: Nest could not find AccountCreatedUpdater element #24

Open vahidvdn opened 2 years ago

vahidvdn commented 2 years ago

I get this error:

Error: Nest could not find AccountCreatedUpdater element (this provider does not exist in the current context)

Here is my account module:

@Module({
  imports: [
    TypeOrmModule.forFeature([Account]),
    CqrsModule,
    CommonModule,
    EventSourcingModule.forFeature(),
  ],
  controllers: [AccountController],
  providers: [
    CreateAccountHandler,
    UserCreatedHandler,
    // this is PROVIDER here
    AccountCreatedUpdater,
  ]
})

As you see AccountCreatedUpdater is actually a part of my module. And the following is my AppModule:

@Module({
  imports: [
    ConfigModule.forRoot({ isGlobal:true }),
    TypeOrmModule.forRootAsync(typeOrmFactory),
    AccountModule,
    EventSourcingModule.forRoot({
      mongoURL: 'mongodb://mymongo:27017/eventstore',
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}

But everything works fine for the example repo

muthyalaDivyaVenkatesh commented 8 months ago

hi,

Did you find the Fix @vahidvdn Nestjs 9 i am also facing similar issue