Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hiendv
Copy link
Contributor

@hiendv hiendv commented Dec 7, 2025

We merged #11181 but forgot to remove some legacy code which read the response.text() for logging. Resulting in this kind of error when getJSONFromResponse tries to parse them

TypeError: Body is unusable: Body has already been read

An example from another user, although the issue is not really related but the error is causing confusion: #11488

Since the logging is done with getJSONFromResponse, we can safely remove the earlier response.text()


  • Tests
    • Tests included/updated
    • Tests not necessary because: I find it hard to write a test with mockOAuthFlow because it's really confusing with the global state and stuff. Already did mockOAuthServerCallback('failure') and msw handler for 400 but it doesn't resolve. Will happily retry if you could give some pointer.
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: Debugging is not documented
  • Wrangler V3 Backport

@hiendv hiendv requested a review from a team as a code owner December 7, 2025 15:57
@changeset-bot
Copy link

changeset-bot bot commented Dec 7, 2025

🦋 Changeset detected

Latest commit: d71b47a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 7, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11550

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11550

miniflare

npm i https://pkg.pr.new/miniflare@11550

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11550

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11550

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11550

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11550

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11550

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11550

wrangler

npm i https://pkg.pr.new/wrangler@11550

commit: 7f2e897

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Dec 11, 2025
@petebacondarwin petebacondarwin self-assigned this Dec 11, 2025
@petebacondarwin petebacondarwin force-pushed the body-unusable-auth-error branch from 7f2e897 to d71b47a Compare December 11, 2025 11:11
@petebacondarwin petebacondarwin merged commit 95d81e1 into cloudflare:main Dec 11, 2025
32 of 39 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Dec 11, 2025
@petebacondarwin
Copy link
Contributor

The original PR that introduced this bug also did not provide tests

petebacondarwin added a commit that referenced this pull request Dec 11, 2025
* fix(wrangler): remove fetchAuthToken's early response.text() for logging

* chore: add changeset

---------

Co-authored-by: hiendv <[email protected]>
dario-piotrowicz pushed a commit that referenced this pull request Dec 11, 2025
* fix(wrangler): remove fetchAuthToken's early response.text() for logging

* chore: add changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants