You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FetchError: The request failed and the interceptors did not return an alternative response
at new FetchError (...)
AbortError: The operation timed out
code: "ABORT_ERR"
and doesn't respect the longer timeout.
What is the expected behavior?
If a signal is given which is longer than the default, it should be respected
What do you see instead?
No response
Additional information
No response
Reacted by Dai Jie, Tobias Petry, orange-GuandeLi, Zhu Liang, Arnold, Tommy D. Rossi, Ayaan Zaidi, BestCodes, Alex, hkiku482 and 6 more
Reacted by Jake, Akrit Woranithiphong, orange-GuandeLi and Arnold
Do note that typescript will scream at you since typescript doesn't know that the fetch have a parameter of timeout. You can suppress it using @ts-ignore or something similar.
Reacted by Dai Jie, orange-GuandeLi, Zhu Liang, Arnold, Christopher Pappas, Luka T. Korošec, BestCodes and Bora Gültekin
I am waiting for this to be fixed since #13302
But apparently that issue was closed for an unknown reason.
I tried again but still seems not to work. My approach:
console.log('oke');// DOES NOT WORKawaitfetch('https://devplesk.mintyserver.nl/a/a/a/a/a',{signal: AbortSignal.timeout(1000),timeout: false})// WORKS without `timeout` prop// await fetch('https://tools.arthurvanl.nl/api/v1/delay/time?duration=6000', {// signal: AbortSignal.timeout(1000), // // timeout: false// })console.log('oke')
This took a very long time to track down due to missing stack traces or any info other than a TimeoutError. Thank you @AkritW for posting your solution 🙏
Activity
RiskyMH commentedon Jan 24, 2025
Related to #13126 and #13302 which are closed but from my tests are still broken.
Your specific is longer though, but just out of curiosity does it let you set lower then 5mins?
Jarred-Sumner commentedon Jan 24, 2025
This is happening because the
timeoutoption infetchdoesn't know anything aboutAbortSignal.timeoutWe can fix it. It won't be 100% robust.
themockingjet commentedon Mar 5, 2025
with 1.2.4
AbortSignal.timeoutonly works with 6 milliseconds settings, higher than that it floatsAkritW commentedon Apr 12, 2025
I tested the timeout option in Bun by setting it to false. It is working.
However, the documentation and typescript also has nothing to say about the timeout option being there.
AkritW commentedon Apr 20, 2025
Here is the current fix.
Do note that typescript will scream at you since typescript doesn't know that the fetch have a parameter of timeout. You can suppress it using @ts-ignore or something similar.
orange-GuandeLi commentedon Aug 4, 2025
Hope it can be fixed soon
arthurvanl commentedon Aug 20, 2025
I am waiting for this to be fixed since #13302
But apparently that issue was closed for an unknown reason.
I tried again but still seems not to work. My approach:
remorses commentedon Oct 1, 2025
Bun should just disable the timeout by default. It causes more problems than benefits
damassi commentedon Oct 30, 2025
This took a very long time to track down due to missing stack traces or any info other than a
TimeoutError. Thank you @AkritW for posting your solution 🙏8 remaining items
fetch: a numeric timeout must not be preempted by the default socket-…
h2: treat a disarmed idle timeout as unbounded in the session aggrega…
e2e: bound per-attempt fetch timeout in spawn waitForReady
fetch: let an explicit `timeout` extend the socket idle deadline (#33647
fetch: add connectTimeout, socketTimeout, and a whole-request timeout
feat(cli): bridge OpenCode native compaction via internal REST API (#…
feat(cli): bridge OpenCode native compaction via internal REST API (#…
Session 29 (2nd continuation): DeepSolve resilience + real Bun-fetch-…
snap: switch runtime from Bun-compiled binary to bundled Node.js
docs: update AGENTS.md and README for the Node.js runtime
coding: disable the Bun runtime's 5-minute fetch timeout under the tr…
provider: timeout SSE reader reads to survive broken streams
feat(cli): bridge OpenCode native compaction via internal REST API (t…
feat(cli): bridge OpenCode native compaction via internal REST API (t…