Skip to content

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

Description

@vahidvdn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions