question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: disturbed

See original GitHub issue

Bug Description

Undici fetch get results in TypeError: disturbed

Reproducible By

N/A

Expected Behavior

Proper response or specific error message

Logs & Screenshots

N/A

Environment

Ubuntu 22.04 LTS, Node v18.4.0

Additional context

N/A

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
jimmywartingcommented, Jul 21, 2022

use clone if you intend to use it multiple times.

res1 = new Response('foo')
res2 = res1.clone()

// best if both are being consumed at the same time...
res1.text()
res2.text()
1reaction
mcollinacommented, Jul 21, 2022

Why cant we use response.text() multiple times? sounds bad to me 😦

That’s how the spec works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript fetch - Failed to execute 'json' on 'Response'
Uncaught (in promise) TypeError: Failed to execute 'json' on 'Response': body stream is locked. I showed the contents of the returned ...
Read more >
Debugging workers specific javascript errors
TypeError : This ReadableStream is disturbed (has already been read from), and cannot be used as a body. I previously had a similar...
Read more >
Response.clone() - Web APIs - MDN Web Docs
clone() throws a TypeError if the response body has already been used. In fact, the main reason clone() exists is to allow multiple...
Read more >
2. Issue - The Atlassian Developer Community
Here is the error. TypeError: body used already for: https://auth.atlassian.com/oauth/token. I followed this flow below and the error occurred ...
Read more >
Fetch Standard
If object is disturbed or locked, then throw a TypeError . If source is a byte sequence, then set action to a step...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found