fetch failed Node.js Origin: Application & API Last updated 13 Oct 2026

TypeError: fetch failed (cause: ConnectTimeoutError / ECONNREFUSED / UND_ERR)

Node’s built-in fetch (undici) couldn’t complete the request; the real reason is in error.cause.

Exact message you may see TypeError: fetch failed
Seen on: Node.js

Meaning

Node 18+ fetch wraps network errors as "fetch failed". Log err.cause: UND_ERR_CONNECT_TIMEOUT (unreachable/IPv6 issues), ECONNREFUSED, ENOTFOUND, or certificate errors.

Common causes

  • Server unreachable / connect timeout
  • localhost resolving to IPv6 ::1 while the server listens on IPv4
  • DNS failure
  • TLS certificate issues
  • Proxy required but not configured (fetch ignores HTTP_PROXY)

⚡ Quick fix

  1. console.error(err.cause) to see the real error
  2. Use 127.0.0.1 instead of localhost
  3. Configure an undici ProxyAgent for corporate proxies

Detailed fix by platform

Node.js

  1. try { await fetch(url); } catch (e) { console.error(e.cause); }

How to diagnose

  1. Cause — What is err.cause?
  2. Address — IPv4 vs IPv6?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

0x80070035 — 0x80070035: The network path was not found (System error 53) (Windows)0x800700350x80072EE7 — Error 0x80072EE7 (Windows Update / Microsoft Store: server name could not be resolved) (Windows)0x80072EE70x8024402C — Windows Update error 0x8024402C (cannot connect to update server) (Windows)0x8024402C14 UNAVAILABLE — gRPC Error: 14 UNAVAILABLE: No connection established / failed to connect to all addresses (API)14 UNAVAILABLE511 — HTTP 511 Network Authentication Required (HTTP)511auth/network-request-failed — Firebase Auth: auth/network-request-failed — A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred (Authentication)auth/network-request-…body already used — TypeError: Failed to execute 'json' on 'Response': body stream already read (JavaScript)body already usedCDN: trunk URL couldn't be downloaded — [!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/... (iOS)CDN: trunk URL couldn…fetch fai…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.