Closed prasid444-niural closed 2 months ago
Any updates in this?
Hi @prasid444-niural - thanks for reaching out.
I tried to reproduce it with code snippet below, similar to yours but was unable to. I noticed you mentioned that this only occurs when using Vite. Can you share necessary steps to reproduce with Vite? Also I can't tell as your code snippet is incomplete, can you verify how you're configuring your credentials, region and such?
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
try {
const client = new S3Client({
region: "us-west-1"
});
const putObjectCommand = new PutObjectCommand({
Bucket: "uploadtest",
Body: "test.xml",
Key: "test.xml",
})
await client.send(putObjectCommand);
} catch (error) {
console.log(error)
}
Best, John
This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Checkboxes for prior research
Describe the bug
While uploading a file to s3, it gives Typeerror. But this happens only when I do
yarn start
and is working correctly in build and serve. This is when using vite, it was working on CRA.error message:
SDK version number
@aws-sdk/client-s3@3.470.0
Which JavaScript Runtime is this issue in?
Browser
Details of the browser/Node.js/ReactNative version
Chrome: 123.0.6312.107 Safari: 17.4.1
Reproduction Steps
Observed Behavior
It seems the send method is trying to extend the argument provided which failed to extend the property
config
possibly due touse strict
mode.Expected Behavior
It should not throw any Typeerror and file should be uploaded successfully as it is done in build mode.
Possible Solution
Either the argument should be extensible by default or we may should be able to configure if strict mode should be removed or not [but I guess this should not be done].
Additional Information/Context
No response