Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Angular’s NG0201: No Provider Found error means the injector could not find a provider for a token required by your code. Start with the token named in No provider for …, then trace the dependency path and check that the exact token is registered at an injector level the requesting code can reach.
What NG0201 means
Angular resolves a class or other injection token by searching providers available to the requester. NG0201 occurs when that search cannot find a matching provider. The error often includes a dependency path such as App → AuthClient → UserClient. In that example, investigate UserClient first: it is the final dependency Angular could not resolve. Then work backward to find which consumer requested it. Angular’s NG0201 reference recommends working backward from the object named in the missing-provider message.
As an Amazon Associate I earn from qualifying purchases.
NG0201 is specifically a missing-provider problem. It is different from NG0203, which means inject() was called outside an injection context, and NG0200, which reports a circular dependency. Angular’s DI troubleshooting guide treats these as separate errors.
Free tools Windows power users keep installed
One-click scans. No signup required.
Diagnose the missing token in order
- Read the complete runtime error. Note the missing token and the dependency path. Begin with the final token in that path, then trace backward to its consumer.
- Check the runtime token and import. Confirm the consumer injects the same class or
InjectionTokenobject that a provider registers. A TypeScript interface alone cannot be injected: interfaces are erased at runtime. For interface-shaped configuration or another non-class value, define anInjectionTokenand provide that token. See Defining dependency providers. - Check the class’s injectable metadata or explicit provider. A service class needs Angular injectable metadata and an available registration. Depending on the intended scope, that may be automatic provision through
@Injectableconfiguration or an entry in a reachableprovidersarray. Angular documents providers on application configuration, NgModules, routes, components, and directives. - Check where the provider is registered. Angular’s injector hierarchy searches from the requester through relevant ancestors; it does not search down into a child injector. A provider registered only by a child component cannot satisfy a request from its parent or a sibling. A route provider is scoped to that route’s injector and context. Use Angular’s hierarchical injector guide to understand the lookup path.
- Check framework setup when the missing token belongs to Angular. Follow the setup guidance for the installed Angular version and bootstrap style. HttpClient setup is version-sensitive; see the next section.
- Inspect the injector tree if registration looks correct. Use Angular DevTools to inspect the failing component’s injector tree and see where the provider is available. A provider present only below the requester, or outside its lookup path, is not reachable from that requester.
Choose a provider scope that matches the service
Provider placement determines which consumers can resolve a token and whether they share an instance or receive a scoped one. Register it at the narrowest scope that serves the intended consumers and lifetime.
#1 Best Overall
| Provider approach | Typical reach and use | What to consider |
|---|---|---|
@Injectable({ providedIn: 'root' }) |
Application-wide availability for a class service. | Use when broad availability and sharing across the application are intended. Check the guidance for the project’s Angular version. |
| Application configuration or NgModule providers | Services or tokens needed at the application or module level. | Choose the registration point that matches the project’s bootstrap style and required reach. |
| Route providers | A service or token needed within a route context. | The route injector scopes availability to that route subtree; consumers outside it may not resolve the provider. |
| Component or directive providers | A service or token needed by that component or directive and its relevant descendants. | A local provider can create a scoped instance. Parents and siblings cannot resolve a provider found only in a child injector. |
InjectionToken with a value or factory |
Configuration, primitives, functions, or values represented by an interface. | Inject and provide the exact same token object. |
Angular describes automatic provision through providedIn and manual registration through provider arrays in its provider guide. Moving a provider higher in the hierarchy expands its reach and can change which consumers share an instance; avoid making that change simply to silence the error.
Check HttpClient setup against your Angular version
Do not assume every Angular major version configures HttpClient the same way. Angular’s current HttpClient setup guide says HttpClient is available for injection by default in Angular v21 and later. It documents provideHttpClient() for application providers and NgModule providers in NgModule-based bootstrap. For an earlier version, follow that version’s setup documentation rather than assuming the v21-and-later behavior applies.
Rank #2
Use optional injection only when absence is valid
Angular’s inject API supports optional injection, which returns null when no provider is found. Use it only when the dependency is genuinely optional and your code deliberately handles the null result. Making a required dependency optional does not register a provider; it changes a clear failure into a nullable value that the application must handle.
Check the error code before changing providers
- NG0201: The injector cannot find a provider for the requested token. Check token identity, registration, and scope.
- NG0203:
inject()was called outside an injection context. Adding a provider does not correct an invalid call context. - NG0200: A circular dependency exists. Registering the missing token differently does not by itself resolve the dependency cycle.
For the full list of Angular error codes, see the Error Encyclopedia. Use the API documentation matching your installed Angular version; for example, Angular’s versioned v18 NG0201 page uses @Injectable guidance.
Quick Recap
Rank #4
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




