Replies: 1 comment 1 reply
-
We use node:streams under the hood so it might not work exactly the same way as in the browser. it may violate the browser spec, but i would also argue that you also used This would be more acceptable: const clone = response.clone()
// consume both streams at the same time
response.pipe(process.stdout)
const data = await clone.json() or just const [text, json] = await Promise.all([response.text(), clone.json()])
// but if that where the case then i would just do
text = await response.text()
json = JSON.parse(text) |
Beta Was this translation helpful? Give feedback.
-
This function works with small response size, but large result in an unexpected nodejs process exit without any error.
I've also posted a nodejs bug about this problem: nodejs/help#3851, but seems it's not a bug.
Is this a
node-fetch
bug or just an example of badresponse.clone()
usage?Beta Was this translation helpful? Give feedback.
All reactions