Question: how to debug hang in node-fetch? (likely environmental issue)
See original GitHub issueOn my Windows 10 dev box, Node 12.17.0, I’m seeing the following code hang:
let result = await fetch("https://sadchonks.com/kitteh-512.png"); // success, 200
let buffer = await result.buffer(); // This hangs, never finishes. No errors, no result. Just hang.
I’m trying to figure out why this hangs. Stepping into the debugger, I reach into consumeBody function, but neither body.on('error', ...)
nor body.on('data', ...)
never fires:
I’ve also tried de-asyncing my code by using .then(…) chains without async. Still no dice; it hangs on the same call to .buffer()
.
Any suggestions for debugging this hang?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Nodejs process hang, how could I debug it or collect dump?
This tool helps with processes which have completed their work but not exited the vm. It does not help with infinite loops, which...
Read more >API Docs | fetch-mock - Wheresrhys
The first step when debugging tests should be to run with the environment variable DEBUG=fetch-mock* . This will output additional logs for debugging...
Read more >rollup.js
rollup.config.js import fetch from 'node-fetch'; export default ... You will rarely need to use this, and should probably be using the command line...
Read more >Load API endpoint sometimes times out - Caddy Community
When it does get “stuck” everything returns to normal after “socket hung up” error. I have no ideas what may be the problem....
Read more >How to Build with Twilio Functions for JavaScript Beginners
There was just one problem. After desperately rummaging through the rental's kitchen cabinets, I found only a single tablespoon hanging ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It still happens and happen accidently. It’s so hard to reproduce and try catch is not work to handle this.
t’s bugged in long run system and became unpredicted. anybody have solution?
I use node 13.6.0
able to reproduce by fetching images in loop, buffer is hitting maximum size and just hanging.