79746622

Date: 2025-08-26 09:09:53
Score: 1
Natty:
Report link

I encountered the same error. This error occurs when using the response, not when awaiting fetch(). To handle the terminated error, you should enclose the code that uses the response in a try catch like below.

async function getResponse(url: string) {
  try {
    const res = await fetch(url)
    if (!res.ok) return 
    return Buffer.from(await res.arrayBuffer()) // may occur `terminated error`
  } catch (err) {/*...*/}
}
Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: noooooooous