anacronw / multer-s3

multer storage engine for amazon s3
MIT License
660 stars 190 forks source link

Type 'AWS.S3' is not assignable to type /node_modules/@types/multer-s3/node_modules/aws-sdk/clients/s3 #163

Closed bertdida closed 2 years ago

bertdida commented 2 years ago

I'm getting this error when building my app. I'm using aws-sdk@^2.1066.0 and multer-s3@^2.10.0. Does anyone know why?

src/routes/middlewares/image-upload.ts:17:3 - error TS2322: Type 'AWS.S3' is not assignable to type 'import("D:/Projects/lambda/driftr-api/node_modules/@types/multer-s3/node_modules/aws-sdk/clients/s3")'.
  The types of 'abortMultipartUpload(...).on' are incompatible between these types.
    Type '{ (event: string, listener: () => void, prepend?: boolean | undefined): AWS.Request<AWS.S3.AbortMultipartUploadOutput, AWS.AWSError>; (event: "validate", listener: (request: AWS.Request<AWS.S3.AbortMultipartUploadOutput, AWS.AWSError>) => void, prepend?: boolean | undefined): AWS.Request<...>; (event: "build", liste...' is not assignable to type '{ (event: string, listener: () => void, prepend?: boolean | undefined): import("D:/Projects/lambda/driftr-api/node_modules/@types/multer-s3/node_modules/aws-sdk/lib/request").Request<import("D:/Projects/lambda/driftr-api/node_modules/@types/multer-s3/node_modules/aws-sdk/clients/s3").AbortMultipartUploadOutput, impo...'.
      Types of parameters 'listener' and 'listener' are incompatible.

17   s3,
     ~~

Found 1 error.
LinusU commented 2 years ago

This should be fixed in version 3.0.0, which uses the AWS SDK v3