Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on lazy TelegrafModule import #1084

Open
MaksimKlimenkov opened this issue Jun 5, 2023 · 0 comments
Open

Error on lazy TelegrafModule import #1084

MaksimKlimenkov opened this issue Jun 5, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@MaksimKlimenkov
Copy link

Example code:

export class AppModule implements NestModule {
  constructor(private lazyModuleLoader: LazyModuleLoader) {}

  onModuleInit() {
    this.lazyModuleLoader.load(() =>
      TelegrafModule.forRootAsync({
	useFactory: async () => ({
	  token: config.bot.token
	}),
      })
    );
  }
}

Getting errors:

Error: Nest can't resolve dependencies of the ListenersExplorerService (TelegrafStage, TELEGRAF_MODULE_OPTIONS, TELEGRAF_BOT_NAME, ModuleRef, DiscoveryService, MetadataAccessorService, MetadataScanner, ?, ExternalContextCreator). Please make sure that the argument ModulesContainer at index [7] is available in the TelegrafCoreModule context.

Potential solutions:
- Is TelegrafCoreModule a valid NestJS module?
- If ModulesContainer is a provider, is it part of the current TelegrafCoreModule?
- If ModulesContainer is exported from a separate @Module, is that module imported within TelegrafCoreModule?
  @Module({
    imports: [ /* the Module containing ModulesContainer */ ]
  })
@evilsprut evilsprut self-assigned this Jul 24, 2023
@evilsprut evilsprut added the enhancement New feature or request label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants