Troubleshooting
How to use this section
Section titled “How to use this section”Every entry follows the same structure so you can scan it quickly during an incident:
- Symptom — the exact message or observable behaviour.
- Cause — what Angular is actually complaining about.
- Diagnosis — how to confirm it in your own code.
- Fix — the concrete change.
- Prevention — how to stop it from coming back.
Quick error index
Section titled “Quick error index”| Code | Message | Page |
|---|---|---|
NG0100 | ExpressionChangedAfterItHasBeenCheckedError | Runtime errors |
NG0200 | Circular dependency in DI | DI errors |
NG0201 | No provider for X | DI errors |
NG0203 | inject() must be called from an injection context | DI errors |
NG0301 | Export not found | Runtime errors |
NG0500–NG0505 | Hydration mismatch | SSR common issues |
NG0750 | @defer requires standalone dependencies | Runtime errors |
NG0912 | Component ID generation collision | Build & tooling |
NG0955 | Duplicate keys in @for track | Runtime errors |
NG0956 | Tracking expression caused re-creation of the entire collection | Runtime errors |
NG02200 | Cannot find a differ | Runtime errors |
NG04002 | Cannot match any routes | Runtime errors |
NG05104 | Root element was not found | Build & tooling |
Symptom index (no error code)
Section titled “Symptom index (no error code)”| What you observe | Likely area |
|---|---|
| The view does not update after data changes | Change detection |
| The app becomes slower the longer it runs | Memory leaks |
| The list re-renders completely on every update | Runtime errors — track |
| API calls fire twice | SSR common issues |
| A stale HTTP response overwrites a newer one | RxJS patterns |
| Build succeeds locally but fails in CI | Build & tooling |
| Bundle size exploded after a small change | Build & tooling |
General debugging toolkit
Section titled “General debugging toolkit”Enable detailed errors in development
Section titled “Enable detailed errors in development”Angular error codes link to angular.dev/errors/NGxxxx. Always read that page first — it is short and precise.
Angular DevTools
Section titled “Angular DevTools”The browser extension gives you:
- Component tree with current inputs, outputs and signal values.
- Profiler showing which component triggered each change detection cycle and how long it took.
- Injector tree, invaluable for
NG0201andNG0200.
Runtime introspection from the console
Section titled “Runtime introspection from the console”// Select a DOM node in the Elements panel, then:ng.getComponent($0); // Component instanceng.getContext($0); // Template context (e.g. @for item)ng.getOwningComponent($0); // Parent componentng.applyChanges(ng.getComponent($0)); // Force change detectionNarrow the surface
Section titled “Narrow the surface”When the cause is unclear, bisect:
- Comment out half of the template.
- Replace real data with a hardcoded literal.
- Remove
OnPushtemporarily — if the problem disappears, it is a change detection issue. - Remove
provideClientHydration()temporarily — if it disappears, it is a hydration issue.