exceeded maximum budget Angular Origin: On your device Last updated 15 Oct 2026

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

The production build is larger than the size limits (budgets) in angular.json, and the build is configured to fail.

Exact message you may see exceeded maximum budgetbundle initial exceeded maximum budgetBudget 500.00 kB was not met byanyComponentStyle exceeded maximum budgetError: bundle initial exceeded maximum budget
Seen on: Angular Angular CLI

Meaning

Angular's budgets guard bundle size: initial, anyComponentStyle, anyScript and others. When a limit is crossed as an error, ng build fails. Fix by shrinking the bundle (lazy loading, removing unused libraries, importing only what you need) or deliberately adjusting the budget if growth is justified.

Common causes

  • Heavy library added to the initial bundle (moment, lodash, charts)
  • Features not lazy-loaded
  • Component styles larger than the anyComponentStyle limit
  • Source maps or dev-only code included
  • Budgets set too low for the current app

⚡ Quick fix

  1. Analyse the bundle: ng build --stats-json + a bundle analyzer
  2. Lazy load routes (loadChildren / loadComponent) and large libraries
  3. Raise the budget in angular.json if growth is intentional

Detailed fix by platform

Angular CLI

  1. ng build --stats-json then npx webpack-bundle-analyzer dist/<app>/stats.json (webpack) or npx esbuild-visualizer for the esbuild builder
  2. Replace moment with date-fns/Temporal, import single functions

Code examples

angular.json budgets

json
"budgets": [
  { "type": "initial", "maximumWarning": "1mb", "maximumError": "1.5mb" },
  { "type": "anyComponentStyle", "maximumWarning": "6kb", "maximumError": "12kb" }
]

How to diagnose

  1. Budget — Which type and size (initial or a style)?
  2. Cause — What grew since the last green build?
  3. Fix — Can it be lazy loaded or removed?

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

Can't find stylesheet to import — Angular (Sass): Error: Can't find stylesheet to import. @import 'variables'; (Angular)Can't find stylesheet…Cannot GET /route on refresh — Angular (production): Cannot GET /dashboard — 404 when refreshing or opening a deep link (Angular)Cannot GET /route on …ChunkLoadError — ChunkLoadError: Loading chunk 123 failed. (JavaScript)ChunkLoadErrorComponent is not resolved: templateUrl — Angular tests: Component 'X' is not resolved: templateUrl: ./x.component.html — Did you run and wait for 'resolveComponentResources()'? (Angular)Component is not reso…Could not find the builder's node package — Angular CLI: Could not find the '@angular-devkit/build-angular:browser' builder's node package / Cannot find module '@angular-devkit/build-angular/package.json' (Angular)Could not find the bu…EmptyError — RxJS: EmptyError: no elements in sequence (firstValueFrom / lastValueFrom on an empty Observable) (Angular)EmptyErrorERESOLVE peer dependency conflict after ng update — Angular: npm ERR! ERESOLVE could not resolve — Conflicting peer dependency: @angular/core@"^16.0.0" (after ng update / ng add) (Angular)ERESOLVE peer depende…Expected to be running in 'ProxyZone' — Angular tests: Error: Expected to be running in 'ProxyZone', but it was not found. (Angular)Expected to be runnin…exceeded …

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.