atls / nestjs

NestJS Custom Workshop
BSD 3-Clause "New" or "Revised" License
33 stars 8 forks source link

[bug] nests deps resolving failed with rabbitmq transport #190

Closed talentumtuum closed 3 years ago

talentumtuum commented 3 years ago

Описание бага

Если использовать rabbitmq транспорт приложение падает при запуске

Воспроизведение

@Module({
  imports: [
    BusModule.forRoot({
      transport: Transport.RabbitMQ,
      configuration: {
        queueName: process.env.QUEUE_NAME,
        connectionString: process.env.BUS_URL,
      },
    }),
  ],
  providers: [],
  controllers: [],
})
export class ServiceModule {}

Материалы

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

Starting the development server...

[Nest] 7344   - 03/30/2021, 5:20:38 PM   [NestFactory] Starting Nest application...
[Nest] 7344   - 03/30/2021, 5:20:38 PM   [InstanceLoader] BusModule dependencies initialized +108ms
[Nest] 7344   - 03/30/2021, 5:20:38 PM   [InstanceLoader] LoggerModule dependencies initialized +1ms
[Nest] 7344   - 03/30/2021, 5:20:38 PM   [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 7344   - 03/30/2021, 5:20:38 PM   [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 7344   - 03/30/2021, 5:20:38 PM   [ExceptionHandler] Nest can't resolve dependencies of the BusRabbitMQModule (Symbol(@atlantis-lab/nestjs-bus/application-container), ?, Logger, ApplicationBootstrap, ExplorerService). Please make sure that the argument Symbol(@atlantis-lab/nestjs-bus/bus-rabbitmq-configuration) at index [1] is available in the BusRabbitMQModule context.

Potential solutions:
- If Symbol(@atlantis-lab/nestjs-bus/bus-rabbitmq-configuration) is a provider, is it part of the current BusRabbitMQModule?
- If Symbol(@atlantis-lab/nestjs-bus/bus-rabbitmq-configuration) is exported from a separate @Module, is that module imported within BusRabbitMQModule?
  @Module({
    imports: [ /* the Module containing Symbol(@atlantis-lab/nestjs-bus/bus-rabbitmq-configuration) */ ]
  })
 +2ms
Error: Nest can't resolve dependencies of the BusRabbitMQModule (Symbol(@atlantis-lab/nestjs-bus/application-container), ?, Logger, ApplicationBootstrap, ExplorerService). Please make sure that the argument Symbol(@atlantis-lab/nestjs-bus/bus-rabbitmq-configuration) at index [1] is available in the BusRabbitMQModule context.

Potential solutions:
- If Symbol(@atlantis-lab/nestjs-bus/bus-rabbitmq-configuration) is a provider, is it part of the current BusRabbitMQModule?
- If Symbol(@atlantis-lab/nestjs-bus/bus-rabbitmq-configuration) is exported from a separate @Module, is that module imported within BusRabbitMQModule?
  @Module({
    imports: [ /* the Module containing Symbol(@atlantis-lab/nestjs-bus/bus-rabbitmq-configuration) */ ]
  })

    at Injector.lookupComponentInParentModules (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/injector.js:188:19)
    at Injector.resolveComponentInstance (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/injector.js:144:33)
    at resolveParam (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/injector.js:98:38)
    at async Promise.all (index 1)
    at Injector.resolveConstructorParams (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/injector.js:113:27)
    at Injector.loadInstance (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/injector.js:46:9)
    at Injector.loadProvider (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/injector.js:68:9)
    at async Promise.all (index 0)
    at InstanceLoader.createInstancesOfProviders (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/instance-loader.js:43:9)
    at /Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/instance-loader.js:28:13
    at async Promise.all (index 3)
    at InstanceLoader.createInstances (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/instance-loader.js:27:9)
    at InstanceLoader.createInstancesOfDependencies (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/injector/instance-loader.js:17:9)
    at /Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/nest-factory.js:90:17
    at Function.asyncRun (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/errors/exceptions-zone.js:18:13)
    at NestFactoryStatic.initialize (/Users/tuogeniy/Documents/atlantis-lab/challenge/node_modules/@nestjs/core/nest-factory.js:88:13)