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.
exceeded maximum budgetbundle initial exceeded maximum budgetBudget 500.00 kB was not met byanyComponentStyle exceeded maximum budgetError: bundle initial exceeded maximum budget 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
anyComponentStylelimit - Source maps or dev-only code included
- Budgets set too low for the current app
⚡ Quick fix
- Analyse the bundle:
ng build --stats-json+ a bundle analyzer - Lazy load routes (
loadChildren/loadComponent) and large libraries - Raise the budget in angular.json if growth is intentional
Detailed fix by platform
Angular CLI
ng build --stats-jsonthennpx webpack-bundle-analyzer dist/<app>/stats.json(webpack) ornpx esbuild-visualizerfor the esbuild builder- Replace
momentwithdate-fns/Temporal, import single functions
Code examples
angular.json budgets
"budgets": [
{ "type": "initial", "maximumWarning": "1mb", "maximumError": "1.5mb" },
{ "type": "anyComponentStyle", "maximumWarning": "6kb", "maximumError": "12kb" }
]How to diagnose
- Budget — Which type and size (initial or a style)?
- Cause — What grew since the last green build?
- 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:
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