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.
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' 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-Originor 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
- Open DevTools → Network and read the red entry plus the console CORS message
- Use the dev-server proxy (
proxy.conf.json) for local API calls - Fix CORS headers on the API for your front-end origin
Detailed fix by platform
Angular
- Log the real error:
this.http.get(url).pipe(catchError(e => { console.error(e); return throwError(() => e); })) - Local dev:
ng serve --proxy-config proxy.conf.json
Linux
- 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
{
"/api": {
"target": "http://localhost:3000",
"secure": false,
"changeOrigin": true
}
}How to diagnose
- Network — What does the Network tab show for the request?
- CORS — Console message about Access-Control?
- 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:
Similar errors
Most viewed in Angular
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 15 Oct 2026