NG6008 Angular Origin: On your device Angular 14+ Last updated 15 Oct 2026

Angular: NG6008: Component X is standalone, and cannot be declared in an NgModule. Did you mean to import it instead?

A standalone component, directive or pipe was listed in an NgModule's declarations array.

Exact message you may see NG6008: Component is standalone, and cannot be declared in an NgModuleis standalone, and cannot be declared in an NgModule. Did you mean to import it instead?cannot be declared in an NgModuleNG6008: Component X is standalone
Seen on: Angular TypeScript

Meaning

Standalone declarables (standalone: true, default since Angular 19) are never declared in modules. Put them in imports instead. After migrating to standalone (or upgrading to v19) leftover declarations entries cause NG6008; the opposite problem (a non-standalone component in imports) gives NG6000-series messages.

Common causes

  • Component generated with standalone: true (or Angular 19 default) but added to declarations
  • Migration to standalone left old module entries
  • Copy-pasted module from an older project
  • Library component that is standalone declared in a module
  • Mixed old/new schematics output

⚡ Quick fix

  1. Move the standalone component from declarations to imports
  2. Or remove standalone: true and keep it declared (v18 and older)
  3. Run the standalone migration schematic

Detailed fix by platform

Angular CLI

  1. ng generate @angular/core:standalone migrates modules step by step

Angular

  1. NgModule: @NgModule({ imports: [UserCardComponent] }) (not declarations)

Code examples

Import, don't declare

typescript
@NgModule({
  declarations: [],                  // standalone components do not belong here
  imports: [CommonModule, UserCardComponent],
})
export class UsersModule {}

How to diagnose

  1. Flag — Is the component standalone?
  2. Module — Where is it listed?
  3. Version — Angular 19+ (standalone default)?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

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 (Angular)exceeded maximum budg…NG0300 — Angular: NG0300: Multiple components match node with tagname app-x: A and B (Angular)NG0300NG0912 — Angular: NG0912: Component ID generation collision detected. Components 'A' and 'B' with selector 'app-x' use the same ID (Angular)NG0912NG8001 — Angular: NG8001: 'app-item' is not a known element — verify that it is included in the component's imports (Angular)NG8001NG8103 — Angular: NG8103: The *ngIf directive was used, but neither the NgIf directive nor the CommonModule was imported (Angular)NG8103NG8113 — Angular: NG8113: NgIf is not used within the template of AppComponent — unused standalone import (Angular)NG8113Schema validation failed with the following errors — Angular CLI: Schema validation failed with the following errors: Data path "" must NOT have additional properties(xyz) (Angular)Schema validation fai…NG6008

Explore the map of this error Full error map →

🧠 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.