-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
clone() hangs with large response in Node #8
Comments
It would be pretty challenging to re-implement We currently clone in three places:
I'm not sure which, if any, of these places would be safe to remove. None of them seem particularly important to me, though I like having them for safety. It's worth noting that we only call For example, if const users = await ky.get('users').json(); It's perfectly fine to re-write that to: const response = await ky.get('users');
const users = await response.json(); ... in which case Other than those workarounds, I'm not sure there's much we can do, since we are using the API correctly and this is really an upstream issue. We could explore alternative fetch polyfills, but I suspect that would again introduce its own set of problems. Let's keep an eye on that issue you referenced. In the meantime, should we consider removing |
I don't think we should remove I'm gonna add a bounty here that applies to getting node-fetch/node-fetch#386. If you want to work on it, see: node-fetch/node-fetch#563 (comment) |
@issuehunt has funded $80.00 to this issue.
|
|
Drive by comment as it seems like wheels are already in motion to fix this: I think this should be added to the README. I've hit this behaviour while writing up endpoint methods for an api in our electron app; b/c I was being lazy I was just running the code via I was really confused for a while, getting ready to deep dive into Given that it seems switching from |
@gutenye @sindresorhus In version fetch(url, {highWaterMark: 10}).then(res => res.clone().buffer()); |
Thanks @sholladay. I can confirm the workaround works for my case with |
@sindresorhus has rewarded $72.00 to @xxczaki. See it on IssueHunt
|
I hit this bug today, it was caused by node-fetch/node-fetch#386
The bug makes
ky-universal
not useable at all in node. (You don't know when the code will hang as you don't know the response size ahead of time)Is there a way to remove
clone()
from the source code?IssueHunt Summary
xxczaki has been rewarded.
Backers (Total: $80.00)
Submitted pull Requests
Tips
The text was updated successfully, but these errors were encountered: