-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Response.clone does not clone in-progress streaming body #6348
Comments
Related to #4765 |
Duplicate of #4765 |
Regression of #913, related to #6969. Also seems to be a duplicate of #1381 and #2477. This is a pretty big issue breaking a lot of things, I hope someone will finally pay attention to it because of how many things this bug effects. There's already an open PR for it, #1693, oh, and in #6468 as well! |
Theres a open pr for ages but the maintainers don't prio such fixes over other things: |
Maybe Polyfill
More Idea
|
I've just run into this... I was trying to show the This gives an error: try {
let responseData = await response.json();
} catch (e) {
let text = await response.text();
// ...
}
According to this SO answer using |
We've run into this issue when implementing our Actions pattern in Astro. We rely on I'd love to see a fix implemented for this! |
@bholmesdev This is the PR adding this functionality, I'm blocked on this too. #12473 |
This is a blocker for us as we also need to clone the request for our tooling, including for @bholmesdev Astro Actions. |
Got the same error while trying to use bun with h3 (v2)
|
clone
method does not clone the body
The fix for this will be included in Bun v1.1.27 |
What version of Bun is running?
1.0.4
What platform is your computer?
Linux 5.10.60.1-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
Calling the
clone()
method on aResponse
object should return an identicalResponse
object, including the body. Instead, it returns aResponse
that's missing the body, but otherwise identical in every other way (that I've found).Minimal reproducible example:
What is the expected behavior?
The program should output two lines to the console, and each should contain the same integer number.
What do you see instead?
The first line will contain the number "0" while the second line contains the expected value.
Additional information
No response
The text was updated successfully, but these errors were encountered: