MetinSeylan / Nestjs-OpenTelemetry

🔭 Deeply Integrated and Auto Instrumented OpenTelemetry module for NestJS
360 stars 42 forks source link

Build Issues when use pnpm #19

Closed Yuuki-Sakura closed 2 years ago

Yuuki-Sakura commented 2 years ago

The follow error is thrown when using pnpm

[ExceptionHandler] Nest can't resolve dependencies of the SDK_INJECTORS (OPEN_TELEMETRY_SDK_CONFIG, ?). Please make sure that the argument ModuleRef at index [1] is available in the OpenTelemetryModule context.

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

package.json

  "dependencies": {
    "@metinseylan/nestjs-opentelemetry": "^2.0.2",
    "@nestjs/common": "^8.2.2",
    "@nestjs/core": "^8.2.2",
    "@nestjs/platform-express": "^8.2.2",
    "@opentelemetry/api": "^1.0.3",
    "@opentelemetry/exporter-jaeger": "^1.0.1",
    "@opentelemetry/sdk-trace-base": "^1.0.1",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^7.2.0"
  },
MetinSeylan commented 2 years ago

@Yuuki-Sakura can you send your module configuration? or which version are you using?

Yuuki-Sakura commented 2 years ago
OpenTelemetryModule.forRootAsync({
      imports: [],
      useFactory: () => {
        return {
          spanProcessor: new SimpleSpanProcessor(
            new JaegerExporter({
              endpoint: 'http://127.0.0.1:14268/api/traces',
            }),
          ),
        };
      },
      inject: [],
    }),

pnpm version: 6.22.2

jchoi2x commented 2 years ago

Same issue here too withyarn