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.
i've encountered the same issue with this error: "Unable to resolve signature of class decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 1".
and the fix that worked for me was:
Check your extensions. For me remove "JavaScript and TypeScript Nightly" extension solved this problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With