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

Nest can't resolve dependencies of the ControllerInjector #51

Open
khoalda opened this issue Nov 4, 2022 · 5 comments
Open

Nest can't resolve dependencies of the ControllerInjector #51

khoalda opened this issue Nov 4, 2022 · 5 comments

Comments

@khoalda
Copy link

khoalda commented Nov 4, 2022

I followed the doc but got an error. Can anyone help me?

image

@njpearman
Copy link

I've just tried adding nestjs-opentelemetry to our application and I'm getting a similar / the same error. Nest doesn't seem to know how to inject ModulesContainer for any of the auto injectors. I've tried setting a specific traceAutoInjectors of [PipeInjector], and with default of all injectors.

Using:

  • "@nestjs/core@8.4.7"
  • "@metinseylan/nestjs-opentelemetry@2.0.7"

@khoalda
Copy link
Author

khoalda commented Nov 15, 2022

I've just tried adding nestjs-opentelemetry to our application and I'm getting a similar / the same error. Nest doesn't seem to know how to inject ModulesContainer for any of the auto injectors. I've tried setting a specific traceAutoInjectors of [PipeInjector], and with default of all injectors.

Using:

  • "@nestjs/core@8.4.7"
  • "@metinseylan/nestjs-opentelemetry@2.0.7"

I solved it by upgrading my NestJS version to 9

@njpearman
Copy link

I tried with NestJS version 9 + nestjs-opentelemetry v3.0.0 but still experienced the same error. Maybe my node_modules/ were in a mess though. I'll try again.

@thefuga
Copy link

thefuga commented Aug 10, 2023

I'm having the same issue after upgrading to NestJS 10. Any updates on this? Thank you!

@nicolasgarnil
Copy link

nicolasgarnil commented Jan 24, 2024

Same problem with NestJS 10 as well. I tried removing ControllerInjector and still getting a similar error:

    OpenTelemetryModule.forRoot({
      traceAutoInjectors: [],
      serviceName: 'my-service',
    }),
[Nest] 27056  - 01/24/2024, 3:26:12 PM   ERROR [ExceptionHandler] Nest can't resolve dependencies of the DecoratorInjector (?). Please make sure that the argument ModulesContainer at index [0] is available in the OpenTelemetryModule context.

Potential solutions:
- Is OpenTelemetryModule a valid NestJS module?
- If ModulesContainer is a provider, is it part of the current OpenTelemetryModule?
- If ModulesContainer is exported from a separate @Module, is that module imported within OpenTelemetryModule?
  @Module({
    imports: [ /* the Module containing ModulesContainer */ ]
  })

Error: Nest can't resolve dependencies of the DecoratorInjector (?). Please make sure that the argument ModulesContainer at index [0] is available in the OpenTelemetryModule context.

Potential solutions:
- Is OpenTelemetryModule a valid NestJS module?
- If ModulesContainer is a provider, is it part of the current OpenTelemetryModule?
- If ModulesContainer is exported from a separate @Module, is that module imported within OpenTelemetryModule?
  @Module({
    imports: [ /* the Module containing ModulesContainer */ ]
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants