body already used 🟨 JavaScript

TypeError: Failed to execute 'json' on 'Response': body stream already read

A fetch Response body was consumed twice (e.g. calling .text() then .json()).

Seen on: JavaScript

Meaning

Response bodies are streams that can be read once. Logging the body and then parsing it again fails.

Common causes

  • Calling res.json() after res.text()
  • Reading the body in an interceptor and again later
  • Retrying with the same Response object

⚡ Quick fix

  1. Read once and reuse: const text = await res.text(); const data = JSON.parse(text)
  2. Use res.clone() if two readers are needed

Detailed fix by platform

JavaScript

  1. javascript
    const copy = res.clone();
    console.log(await copy.text());
    const data = await res.json();

How to diagnose

  1. Reads — Where is the body read?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.