codebrick-corp / nestjs-ddtrace

NestJS Datadog Trace Library
52 stars 20 forks source link

Build error: Types incorrectly extend Otel counter parts incorrectly in Nest v9 #22

Closed rathod-sahaab closed 1 year ago

rathod-sahaab commented 1 year ago
node_modules/dd-trace/index.d.ts:1666:20 - error TS2430: Interface 'import("/usr/src/app/node_modules/dd-trace/index").opentelemetry.TracerProvider' incorrectly extends interface 'import("/usr/src/app/node_modules/@opentelemetry/api/build/src/trace/tracer_provider").TracerProvider'.
  The types of 'getTracer(...).startSpan(...).recordException' are incompatible between these types.
    Type '(exception: Exception, time?: TimeInput) => void' is not assignable to type '{ (exception: Exception, time?: TimeInput): void; (exception: Exception, attributes?: Attributes, time?: TimeInput): void; }'.
      Types of parameters 'time' and 'attributes' are incompatible.
        Type 'Attributes' is not assignable to type 'TimeInput'.
          Type 'Attributes' is missing the following properties from type 'Date': toDateString, toTimeString, toLocaleDateString, toLocaleTimeString, and 37 more.

1666   export interface TracerProvider extends otel.TracerProvider {
                        ~~~~~~~~~~~~~~
node_modules/dd-trace/index.d.ts:1697:20 - error TS2430: Interface 'import("/usr/src/app/node_modules/dd-trace/index").opentelemetry.Tracer' incorrectly extends interface 'import("/usr/src/app/node_modules/@opentelemetry/api/build/src/trace/tracer").Tracer'.

1697   export interface Tracer extends otel.Tracer {
                        ~~~~~~
node_modules/dd-trace/index.d.ts:1772:20 - error TS2430: Interface 'import("/usr/src/app/node_modules/dd-trace/index").opentelemetry.Span' incorrectly extends interface 'import("/usr/src/app/node_modules/@opentelemetry/api/build/src/trace/span").Span'.
  Types of property 'recordException' are incompatible.
    Type '(exception: Exception, time?: TimeInput) => void' is not assignable to type '{ (exception: Exception, time?: TimeInput): void; (exception: Exception, attributes?: Attributes, time?: TimeInput): void; }'.

1772   export interface Span extends otel.Span {
                        ~~~~

Found 3 error(s).

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error: The command '/bin/sh -c yarn build' returned a non-zero code: 1

Dependencies

    "@fastify/cookie": "^8.3.0",
    "@fastify/csrf-protection": "^6.3.0",
    "@fastify/helmet": "^10.1.0",
    "@golevelup/nestjs-rabbitmq": "3.3.0",
    "@golevelup/ts-jest": "^0.3.4",
    "@nestjs/axios": "^2.0.0",
    "@nestjs/cache-manager": "^1.0.0",
    "@nestjs/common": "^9.3.8",
    "@nestjs/config": "^2.3.1",
    "@nestjs/core": "^9.3.8",
    "@nestjs/jwt": "^10.0.2",
    "@nestjs/mongoose": "^9.2.1",
    "@nestjs/passport": "^9.0.3",
    "@nestjs/platform-fastify": "^9.3.8",
    "@nestjs/platform-socket.io": "^9.4.0",
    "@nestjs/schedule": "^2.2.1",
    "@nestjs/swagger": "^6.2.1",
    "@nestjs/websockets": "^9.4.0",
    "@novu/node": "^0.17.2",
    "@sendgrid/mail": "^7.7.0",
    "amqp-connection-manager": "^4.1.14",
    "amqplib": "^0.10.3",
    "argon2": "^0.28.5",
    "aws-sdk": "^2.1125.0",
    "axios": "^1.3.1",
    "cache-manager": "^3.6.1",
    "cache-manager-ioredis": "^2.1.0",
    "class-transformer": "^0.5.1",
    "class-validator": "^0.14.0",
    "country-state-city": "^3.1.2",
    "dayjs": "^1.11.7",
    "dd-trace": "^4.15.0",
    "fast-geoip": "^1.1.88",
    "fastify": "^4.15.0",
    "google-auth-library": "^8.0.1",
    "googleapis": "^110.0.0",
    "mongodb": "^5.0.1",
    "mongoose": "^6.7.2",
    "nestjs-ddtrace": "^3.0.4",
    "passport": "^0.6.0",
    "passport-jwt": "^4.0.0",
    "passport-local": "^1.0.0",
    "pg": "^8.8.0",
    "prom-client": "^14.2.0",
    "reflect-metadata": "^0.1.13",
    "rimraf": "4.4.0",
    "rxjs": "^7.2.0",
    "socket.io": "^4.6.1",
    "stripe": "^12.9.0",
    "stripe-event-types": "^2.4.0",
    "unique-names-generator": "^4.7.1",
    "winston": "^3.8.2",
    "winston-daily-rotate-file": "^4.7.1"
  },
  "devDependencies": {
    "@nestjs/cli": "^9.2.0",
    "@nestjs/schematics": "^9.0.4",
    "@nestjs/testing": "^9.3.8",
    "@types/cache-manager": "^3.4.3",
    "@types/cache-manager-ioredis": "^2.0.2",
    "@types/jest": "27.4.1",
    "@types/node": "^18.7.18",
    "@types/passport-jwt": "^3.0.6",
    "@types/passport-local": "^1.0.34",
    "@types/pg": "^8.6.5",
    "@types/supertest": "^2.0.11",
    "@typescript-eslint/eslint-plugin": "^5.0.0",
    "@typescript-eslint/parser": "^5.0.0",
    "eslint": "^8.0.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "jest": "^29.0.0",
    "jest-mock-extended": "^3.0.4",
    "prettier": "^2.3.2",
    "supertest": "^6.1.3",
    "ts-jest": "^29.1.1",
    "ts-node": "^10.0.0",
    "typescript": "^5.1.6"
rathod-sahaab commented 1 year ago

Seems like dd-trace issue https://github.com/DataDog/dd-trace-js/issues/3624