I encountered an error while attempting to decorate a class in my NestJS service.
The Typescript code compiles without any issues, but I am facing 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)
Here is 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,
}
}
This is 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 have attempted reinstalling TypeScript and removing node modules, but the issue persists.