I want to set the file limit on upload using
new MaxFileSizeValidator({ maxSize: this.configService.get<number>('uploadLimit') }),
and I receive configService
on controller
constructor(private readonly configService: ConfigService) {}
The problem that I have currently is that I get an error on
this.configService.get<number>('uploadLimit')
Saying that Object is possibly 'undefined'.
I found this solution, but is it somehow possible to fix it without implementing custom interceptor or anything complex?