Skip to content

Argument of type 'undefined' is not assignable to parameter of type 'string | symbol'Β #110

@taikishiino

Description

@taikishiino

HiπŸ‘‹
After doing the nest build, I am getting the following error.
I think it is probably related to the fact that I have updated to TypeScript 5 series.
Is there any workaround for this?

src/common/sentry/sentry.service.ts:6:16 - error TS1239: Unable to resolve signature of parameter decorator when called as an expression.
  Argument of type 'undefined' is not assignable to parameter of type 'string | symbol'.

6   constructor(@InjectSentry() private readonly sentry: Sentry) {}
                 ~~~~~~~~~~~~~~

Verification Codes

import { Injectable } from '@nestjs/common'
import { InjectSentry, SentryService as Sentry } from '@ntegral/nestjs-sentry'

@Injectable()
export class SentryService {
  constructor(@InjectSentry() private readonly sentry: Sentry) {}

  sendException(exception: Error): void {
    this.sentry.instance().captureException(exception)
  }
}

environment

  • "@nestjs/common": "^9.3.11"
  • "@nestjs/core": "^9.3.11"
  • "typescript": "^5.0.2"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions