angular
Angular Errors
Runtime and compiler error codes thrown by the Angular framework. Each code is prefixed with NG followed by a numeric identifier and links to the Angular documentation for details.
17 codes
references angular.dev/errors
· All codes 17 codes
- NG0100 Expression Changed After Checked A binding expression produced a different value during the second change-detection pass than it did during the first. Common causes include computed values with side effects, or setting component state inside ngAfterViewInit. Run in development mode to surface this; wrap the triggering code in setTimeout or markForCheck to resolve it.
- NG0200 Circular Dependency in DI Angular's dependency injection detected a circular dependency: token A requires B which requires A. Break the cycle by introducing an abstract interface, using a factory provider, or restructuring the dependency graph.
- NG0201 No Provider Found Angular could not find a provider for the requested token in the current injection context. Ensure the service is listed in the providers array of the relevant module, component, or is decorated with @Injectable({ providedIn: 'root' }).
- NG0203 inject() called outside injection context inject() or runInInjectionContext() was called outside of a valid injection context such as a constructor, field initializer, or factory function. Move the inject() call to a constructor or use runInInjectionContext() to wrap it.
- NG0300 Cannot Match Any Routes The Angular router could not find a route matching the requested URL. Add a wildcard route (**) to handle unmatched URLs, or verify that the route configuration and any lazy-loaded modules are set up correctly.
- NG0301 Export Not Found A directive or component was exported from an NgModule but was not declared or imported in that module. Add the directive/component to the declarations or imports array of the exporting module.
- NG0302 Pipe Not Found A pipe used in a template is not available in the current context. For module-based applications, add the pipe to the declarations or imports of the hosting NgModule. For standalone components, import the pipe directly in the component's imports array.
- NG0303 Can't Bind to Property A template binding targets a property that Angular does not recognise on the element or component. The property may be misspelled, missing an @Input() decorator, or the hosting module may not import the directive that provides it.
- NG0400 Wrong Async Validator Return Type An async validator function returned a value that is not a Promise or Observable. Async validators must return Promise<ValidationErrors | null> or Observable<ValidationErrors | null>.
- NG0500 Hydration Node Mismatch During server-side rendering hydration, Angular found a DOM node that does not match what the server rendered. This usually indicates the DOM was mutated between server render and client hydration, or a non-deterministic template expression.
- NG0501 Hydration Missing Siblings During hydration, Angular expected sibling DOM nodes that were not present in the document. Ensure the server and client render the same number of elements and that no DOM manipulation occurs before hydration completes.
- NG0502 Hydration Missing Node During hydration, Angular expected a DOM node that was not present. The server-rendered HTML may have been stripped, the component tree may differ, or a third-party library may have modified the DOM before hydration.
- NG0600 Writing to signals not allowed in computed or effect A signal was written to inside a computed() or effect() function without using untracked(). Computed expressions and effects must be side-effect-free with respect to signal writes; use untracked() or move the write outside the reactive context.
- NG0910 Unsafe Bindings on iframe Angular detected a property binding on an <iframe> element that could allow sandbox or security policy escapes. Use the explicit [attr.src] or [attr.srcdoc] binding syntax, or sanitize the value with DomSanitizer.
- NG0950 Required Input Not Supplied A component or directive has an @Input() marked as required but no value was provided by the parent template. Add the binding in the parent template or remove the required flag if the input is truly optional.
- NG8001 Unknown Element An unknown HTML element or component selector was used in a template. If it is a custom element, add CUSTOM_ELEMENTS_SCHEMA to the module's schemas. If it is an Angular component, ensure the component is declared or imported in the correct module or standalone imports.
- NG8002 Unknown Property A property binding or @Input() in a template references a property that does not exist on the target element or directive. Check the spelling, ensure the directive is imported, and verify the property is decorated with @Input().