Progrider

Programming discussion

Board index
HelpOpen discussion

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?

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.

Add a reply

Plain text. Public, and removed when the thread expires.

Posts and requests are logged for research. Privacy notice.