Http failure response for (unknown url): 0 Unknown Error Angular Origin: On your device Last updated 15 Oct 2026

Angular: HttpErrorResponse — Http failure response for (unknown url): 0 Unknown Error (status 0)

HttpClient got no HTTP response at all: the request was blocked (CORS), failed at network level, or the server is unreachable — status 0 is not a server status.

Exact message you may see Http failure response for (unknown url): 0 Unknown ErrorHttpErrorResponse status 00 Unknown ErrorHttp failure response for http://localhost:3000/api: 0 Unknown ErrorstatusText: 'Unknown Error'
Seen on: Angular TypeScript

Meaning

Status 0 means the browser never delivered a response to JavaScript. Open the Network tab: a red request with a CORS message, a mixed-content or certificate error, an ad blocker, offline mode, a wrong URL/port, or a server crash all show up as 0 Unknown Error. Fix the underlying network or CORS problem; the message itself carries no detail.

Common causes

  • CORS blocked the request (missing Access-Control-Allow-Origin or preflight failing)
  • Server down, wrong host or port, or connection refused
  • Mixed content (HTTP API called from an HTTPS page) or certificate error
  • Ad blocker or browser extension cancelling the request
  • Request aborted by a navigation, timeout or offline state

⚡ Quick fix

  1. Open DevTools → Network and read the red entry plus the console CORS message
  2. Use the dev-server proxy (proxy.conf.json) for local API calls
  3. Fix CORS headers on the API for your front-end origin

Detailed fix by platform

Angular

  1. Log the real error: this.http.get(url).pipe(catchError(e => { console.error(e); return throwError(() => e); }))
  2. Local dev: ng serve --proxy-config proxy.conf.json

Linux

  1. Reproduce outside the browser: curl -v https://api.example.com/data — if curl works, the cause is CORS/browser-side

Code examples

proxy.conf.json

json
{
  "/api": {
    "target": "http://localhost:3000",
    "secure": false,
    "changeOrigin": true
  }
}

How to diagnose

  1. Network — What does the Network tab show for the request?
  2. CORS — Console message about Access-Control?
  3. Server — Does curl reach the API?

🔧 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: On your device. Errors that are often confused with or caused by this one (click to open):

CORS — CORS Error: No 'Access-Control-Allow-Origin' header is present (API)CORSFailed to fetch — TypeError: Failed to fetch / NetworkError when attempting to fetch resource (JavaScript)Failed to fetchHttp failure during parsing — Angular: Http failure during parsing for http://…: SyntaxError: Unexpected token '<' (response is not JSON) (Angular)Http failure during p…Http failure response: 404 Not Found — Angular: Http failure response for http://…/api/x: 404 Not Found (HttpErrorResponse) (Angular)Http failure response…NullInjectorError: No provider for HttpClient! — Angular: NullInjectorError: No provider for HttpClient! — provideHttpClient() missing (Angular)NullInjectorError: No…proxy.conf.json not working — Angular CLI: [HPM] Error occurred while proxying request localhost:4200 to http://localhost:3000 [ECONNREFUSED] (Angular)proxy.conf.json not w…Schema validation failed with the following errors — Angular CLI: Schema validation failed with the following errors: Data path "" must NOT have additional properties(xyz) (Angular)Schema validation fai…Http fail…

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.