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.
CodePudding user response:
Check your extensions. For me remove "JavaScript and TypeScript Nightly" extension solved this problem.