this.client.send is not a function error with Multer S3 & AWS SDK

1.1k Views Asked by At

Getting this error when trying to upload file to aws s3 using aws-sdk(V2) & multer-s3(V3)

TypeError: this.client.send is not a function
    at Upload.__uploadUsingPut (C:\Working Projects\node_modules\@aws-sdk\lib-storage\dist-cjs\Upload.js:66:57)
    at Upload.__doConcurrentUpload (C:\Working Projects\node_modules\@aws-sdk\lib-storage\dist-cjs\Upload.js:129:39)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async Upload.__doMultipartUpload (C:\Working Projects\node_modules\@aws-sdk\lib-storage\dist-cjs\Upload.js:211:9)     
    at async Upload.done (C:\Working Projects\node_modules\@aws-sdk\lib-storage\dist-cjs\Upload.js:39:16) { storageErrors: [] }
1

There are 1 best solutions below

0
Aflah vp On

This error is caused by the version of aws-sdk, multer-s3 and multer. So downgrading the packages will solve the issue.

npm i [email protected]
npm i [email protected]
npm i [email protected]