got: Broken with Node.js ≥ 13.10.0
Describe the bug
- Node.js version: 13.10.0 or 13.10.1
- OS & version: Linux 5.5.6-1-MANJARO x86_64 GNU/Linux
got.stream
does not work with Node.js ≥ 13.10.0. Node.js 13.9.0 works fine.
Actual behavior
When piped into a stream, the receiving stream receives no data.
Expected behavior
When piped into a stream, the receiving stream receives the entire HTTP response.
Code to reproduce
const got = require("got");
got.stream("https://www.github.com/").pipe(process.stdout);
// one can also use stream.pipeline here. Same result.
With Node.js < 13.9.0, output fills the screen. With ≥ 13.10.0, there is no console output.
Checklist
- I have read the documentation.
- I have tried my code with the latest version of Node.js and Got.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 13
- Comments: 19
Same behavior here but all got is affected not only streams :
This code never throws, exits or output results. It only display
step 1
and do nothing more. Before node 13.10.0 it displays results.2 hours of debugging and searching for my mistake… 😄 Same here after upgrading Node to v13.10.1.
Can you provide a reproducible example ? Your use case is too imprecise. I use got and node (v13.11.0) intensively and I have no problem other than https://github.com/sindresorhus/got/issues/1096 which is not node version related and is similar to yours.
Nose.js v13.x is not an LTS branch.
Updating to Node.js v13.11.0 has fixed the issue for me!
LOL @nodejs messed up!
gives
This is the culprit: https://github.com/nodejs/node/pull/31940/files#diff-eefad5e8051f1634964a3847b691ff84R36
It calls
.abort()
on every request you make usingpipeline
.https://github.com/nxtedition/node/blob/5a55b1df97a1f93c5fb81bf758050d81524ae834/lib/internal/streams/destroy.js#L166
It’s gonna be a patch release. I’m working on this right now.
As of Node.js
v13.11.0
and 48b817e all tests pass 😄I am sure. I see you haven’t looked at Got source code. Few people do.