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

**Code:** `NG6008` · **Category:** Angular · **Seen on:** Angular, TypeScript

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

## 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)?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/angular/ng6008-standalone-cannot-be-declared)
