Angular: NG0201: No provider for X found in NodeInjector
A component or directive asked for a service no injector in its tree provides.
NG0201: No provider forNo provider for X found in NodeInjectorNo provider for ControlContainer found in NodeInjectorNo provider for NgControl found in NodeInjector Meaning
Unlike the older NullInjectorError, this message comes from the element injector (a component, directive or pipe). Provide the service with providedIn: 'root', in the component's providers, or in the route/bootstrap providers.
Common causes
- Service lacks
@Injectable({ providedIn: 'root' })and is not in anyproviders - Provider declared in a lazy-loaded module/route not covering this component
- A directive/pipe injecting a token that must be provided by its host (for example
NgControl) - Parent-only token injected with the wrong
@Host/@Optionalflags - Test module without the required provider
⚡ Quick fix
- Add
providedIn: 'root'or list the service inproviders - Provide it at the right level (route, component or bootstrapApplication)
- Add the provider to the TestBed in tests
Detailed fix by platform
Angular
@Injectable({ providedIn: 'root' })on the service- Bootstrap:
bootstrapApplication(AppComponent, { providers: [provideHttpClient()] })
Code examples
Provide at the right level
@Component({
selector: 'app-cart',
standalone: true,
providers: [CartService], // component-level instance
template: `...`,
})
export class CartComponent { cart = inject(CartService); }How to diagnose
- Token — Which service or token is named?
- Provider — Where is it provided?
- Tree — Is the component inside that provider's scope?
🔧 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
- exceeded 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
- NG0200 Angular: NG0200: Circular dependency in DI detected for X
- NG0203 Angular: NG0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer or a function used with runInInjectionContext
Most viewed in Angular
- NG0100 Angular: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked
- NG8002 Angular: NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'
- Cannot GET /route on refresh Angular (production): Cannot GET /dashboard — 404 when refreshing or opening a deep link
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