Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

S3 - pre-signer Typescript Error #6391

Unanswered
manthan0x23 asked this question in Q&A
Discussion options

src/core/services/s3.service.ts:59:45 - error TS2345: Argument of type 'S3Client' is not assignable to parameter of type 'Client<any, object, MetadataBearer, any>'.
 Type 'S3Client' is missing the following properties from type 'Client<any, object, MetadataBearer, any>': middlewareStack, send
59 const pre_sign_url = await getSignedUrl(s3_client, command, {
 ~~~~~~~~~
Found 1 error.
[nodemon] app crashed - waiting for file changes before starting...

I am getting the above error on using s3-presigner sdk


 const command = new PutObjectCommand({
 Bucket: this.bucket_name,
 Key: key,
 ContentType: contentType,
 });
 const s3_client = new S3Client({
 credentials: {
 accessKeyId: this.access_key_id,
 secretAccessKey: this.secret_access_key,
 },
 region: this.bucket_region,
 });
 const pre_sign_url = await getSignedUrl(s3_client, command, {
 expiresIn: 5 * 60,
 });
You must be logged in to vote

Replies: 2 comments

Comment options

const signedUrl = await getSignedUrl(s3Client as unknown as Client<any, any, any>, command, { expiresIn: 3600 });

You must be logged in to vote
0 replies
Comment options

Worth checking if your s3client and presigner libraries the same version number?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /