-
Notifications
You must be signed in to change notification settings - Fork 637
S3 - pre-signer Typescript Error #6391
Unanswered
manthan0x23
asked this question in
Q&A
-
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,
});
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
Replies: 2 comments
-
const signedUrl = await getSignedUrl(s3Client as unknown as Client<any, any, any>, command, { expiresIn: 3600 });
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
-
Worth checking if your s3client and presigner libraries the same version number?
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment