What am I doing wrong?
JavaScript
x
6
1
@Post('upload')
2
@UseInterceptors(FileInterceptor('file'))
3
async upload( @UploadedFile() file) {
4
console.log(file)
5
}
6
file is undefined
Advertisement
Answer
The code works as expected in a fresh project. Hence, the dependencies are corrupt. Deleting the node_modules
folder and running npm install
solves the problem.