Skip to content

TypeError: Failed to fetch #5334

Closed
smithy-lang/smithy-typescript
#1016
@siamahnaf

Description

@siamahnaf

Checkboxes for prior research

Describe the bug

Hello, I am getting an type error when I am using this package into nextjs projects.

TypeError: Failed to fetch

Here is image of error-

image

In Console I am find this-

Uncaught (in promise) TypeError: Failed to fetch at FetchHttpHandler.handle (fetch-http-handler.js:56:1) at async eval (flexibleChecksumsResponseMiddleware.js:17:1) at async eval (deserializerMiddleware.js:2:24)

Here is my usage of this package-

          const params = {
            Bucket: this.config.bucketName,
            Key: key,
            Body: file,
            ACL: "public-read",
            Metadata: {
                uuid: "14365123651274",
                tag: "",
            },
            ContentType: file.type,
            ServerSideEncryption: "AES256",
        };
        const command = new PutObjectCommand(params);
        const data = await client.send(command);

What is the main problem.

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

18.17.0

Reproduction Steps

const client = new S3Client({
            region: this.config.region,
            credentials: {
                accessKeyId: this.config.accessKeyId,
                secretAccessKey: this.config.secretAccessKey,
            }
        });
        const params = {
            Bucket: this.config.bucketName,
            Key: key,
            Body: file,
            ACL: "public-read",
            Metadata: {
                uuid: "14365123651274",
                tag: "",
            },
            ContentType: file.type,
            ServerSideEncryption: "AES256",
        };
        const command = new PutObjectCommand(params);
        const data = await client.send(command);

Observed Behavior

It just thawed error.

Expected Behavior

It should work perfectly!

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p0This issue is the highest prioritypending-releaseThis issue will be fixed by an approved PR that hasn't been released yet.workaround-availableThis issue has a work around available.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions