Http failure response: 404 Not Found Angular Origin: On your device Last updated 15 Oct 2026

Angular: Http failure response for http://…/api/x: 404 Not Found (HttpErrorResponse)

The API answered 404 — the URL is wrong (base URL, path or id), or the proxy/rewrite does not forward the request.

Exact message you may see Http failure response for 404 Not Found404 Not Found HttpErrorResponseHttp failure response for http://localhost:4200/api/users: 404 Not FoundHttpErrorResponse status: 404ERROR HttpErrorResponse 404
Seen on: Angular TypeScript

Meaning

HttpClient throws HttpErrorResponse for 4xx/5xx. A 404 in Angular apps usually comes from a missing /api prefix, a wrong environment base URL, a dev proxy that does not rewrite the path, or hosting that serves index.html for unknown API paths. The error.url shows exactly which URL was called.

Common causes

  • Wrong base URL or missing prefix (/api) in the service
  • Environment file points at the wrong host or stage
  • Dev proxy not forwarding or not rewriting the path
  • Resource really does not exist (bad id)
  • Route removed or renamed on the back end

⚡ Quick fix

  1. Log error.url and compare it with the API docs
  2. Check environment.ts and the proxy config
  3. Test the same URL with curl or Postman

Detailed fix by platform

Angular

  1. this.http.get(${environment.apiUrl}/users/${id}).pipe(catchError(err => { console.error(err.url, err.status); return EMPTY; }))
  2. Check fileReplacements in angular.json for production builds

Linux

  1. curl -i https://api.example.com/users/7

How to diagnose

  1. URL — What is error.url?
  2. Env — Correct environment file used for this build?
  3. API — Does the endpoint exist?

🔧 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):

404 — HTTP 404 Not Found (HTTP)404exceeded maximum budget — Angular build: Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 120.00 kB with a total of 1.12 MB (Angular)exceeded maximum budg…Http 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 for (unknown url): 0 Unknown Error — Angular: HttpErrorResponse — Http failure response for (unknown url): 0 Unknown Error (status 0) (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.