简体   繁体   中英

Typescript Unable to resolve signature of parameter of decorator in vscode

I'm getting the error when I'm decorating the class in nestjs service.

The Typescript is compiling without errors, and I'm getting this problem only in VSCode.

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'.ts(1239)

My tsconfig

{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": false,
    "removeComments": true,
    "strictNullChecks": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "ES2020",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
    "skipLibCheck": true,
  }
}

My Class

export class AuthService {
  private readonly logger = new Logger('AuthService');
  constructor(
    private readonly jwtService: JwtService,
    private readonly prisma: PrismaService,
    private readonly passwordService: PasswordService,
    private readonly configService: ConfigService,
    private readonly twilioService: TwilioService,
    private readonly userService: UsersService,
    @InjectQueue('nest-worker') private nestWorkerQueue: Queue,
    @InjectQueue('mailsend') private mailSend: Queue,
    @Inject(CACHE_MANAGER) protected readonly cacheManager: Cache,
    private readonly mailerService: MailService
  ) {}

I tried reinstalling typescript removing node modules, but the problem persists.

Check your extensions. For me remove "JavaScript and TypeScript Nightly" extension solved this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM