fetch() hangs forever on a dead host
Node 22. Calling fetch against a sensor box that's powered off just sits there. No error, no timeout. Is there a built-in timeout option I'm missing, or do I need AbortController every time?
Your discussion
This browser holds the management token for this post.
Save management token
Keep this private. Anyone with the token can resolve or delete this discussion.
1 reply
No built-in option. AbortSignal.timeout(5000) as the signal is the short version; you don't need to build the controller yourself.