Node.js 18+ `fetch()` TypeError: fetch failed (UND_ERR_CONNECT_TIMEOUT / IPv6 Happy Eyeballs)

Built-in Undici fetch timed out connecting over broken IPv6 or corporate proxy.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Node.js 18+ `fetch()` TypeError Platform: Node.js
Common Root Causes:
  • Built-in Undici fetch timed out connecting over broken IPv6 or corporate proxy.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Log `err.cause`, pass `AbortSignal.timeout(10000)`, and verify DNS/IPv6 connectivity.
Safe Diagnostic Command:
Inspect `err.cause.code` on caught fetch error
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Built-in Undici fetch timed out connecting over broken IPv6 or corporate proxy. Recommended diagnostic: `Inspect `err.cause.code` on caught fetch error`. Remediation: Log `err.cause`, pass `AbortSignal.timeout(10000)`, and verify DNS/IPv6 connectivity.

Worked Examples

  • Run `Inspect `err.cause.code` on caught fetch error` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-node-fetch-undici-connect-timeout · Independently verified: 2026-11-25

Related Resources