NG0955 Angular Origin: On your device Angular 17+ Last updated 15 Oct 2026

Angular: NG0955: The provided track expression resulted in duplicated keys for a given collection (@for)

In an @for block (or trackBy), two items produced the same tracking key, so Angular cannot match them to DOM nodes reliably.

Exact message you may see NG0955: The provided track expression resulted in duplicated keysThe provided track expression resulted in duplicated keys for a given collectionduplicated keys for a given collection
Seen on: Angular TypeScript

Meaning

track must return a unique, stable value per item (an id). Duplicate keys — or tracking by a non-unique field or $index of changing lists — make Angular reuse the wrong nodes, causing glitches and the NG0955 warning. A related warning NG0956 reports a full list re-creation when keys change.

Common causes

  • Tracking by a field that is not unique (name, category)
  • Items really contain duplicate ids from the API
  • track $index on a list that reorders or filters
  • Generating new ids on every render (Math.random())
  • Merging two lists without deduplication

⚡ Quick fix

  1. Track by a unique id: track item.id
  2. Deduplicate data before rendering
  3. Avoid random or index-based keys on dynamic lists

Detailed fix by platform

Angular

  1. @for (u of users; track u.id) { ... }
  2. Check duplicates: new Set(users.map(u => u.id)).size !== users.length

Code examples

Unique keys

html
@for (u of users; track u.id) {      <!-- u.id must be unique and stable -->
  <app-user-row [user]="u" />
} @empty {
  <p>No users</p>
}

How to diagnose

  1. Key — What does track return?
  2. Data — Are ids unique in the response?
  3. List — Does it reorder or refilter?

🔧 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):

Cannot find control with name — Angular: Error: Cannot find control with name: 'email' (reactive forms) (Angular)Cannot find control w…Could not find the builder's node package — Angular CLI: Could not find the '@angular-devkit/build-angular:browser' builder's node package / Cannot find module '@angular-devkit/build-angular/package.json' (Angular)Could not find the bu…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…NG0100 — Angular: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked (Angular)NG0100NG02200 — Angular: NG02200: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays (Angular)NG02200NG8103 — Angular: NG8103: The *ngIf directive was used, but neither the NgIf directive nor the CommonModule was imported (Angular)NG8103Schema 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…NG0955

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.