Skip to content

Body is unusable: Body has already been read #6749

@Dzhuneyt

Description

@Dzhuneyt

We get the following error:

Body is unusable: Body has already been read

With a full stack trace of:

TypeError: Body is unusable: Body has already been read\n    at consumeBody (node:internal/deps/undici/undici:5712:15)\n    at _Response.text (node:internal/deps/undici/undici:5662:18)\n    at getSocialProfiles (/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@types+react@19_605ee2228ea18b8f2238828fa077d891/node_modules/thirdweb/src/social/profiles.ts:41:72

I've isolated the error to this line.

My theory is that JSON parsing the response body on line 37 fails, and the subsequent catch block tries to access the same body again, leading to the obvious error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions