The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Angular NG0955 means an @for loop’s track expression returns the same key for two or more items. Use a key that uniquely identifies each item—typically a stable property such as id or uuid—so Angular can associate each item with the correct rendered view.
What NG0955 means
In an Angular @for block, the expression after track supplies a key Angular uses to connect each collection item to its rendered DOM view. NG0955 is reported when that expression produces duplicate keys within the collection. The items themselves do not have to be duplicates: distinct objects can share a descriptive field such as a name, category, or displayed value. Angular’s NG0955 error guide demonstrates this with repeated values even though the objects have distinct keys.
When multiple items share a key, Angular cannot uniquely associate each one with its view. During moves or removals, it may associate a DOM node with a different item that has the same key. Angular also warns that duplicate keys require more sophisticated, slower data structures during reconciliation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
How to find and fix the duplicate
- Find the affected loop. Locate the
@forblock associated with the warning and inspect the expression aftertrack. - Check the collection for collisions. Look at the actual items and compare the value returned by that expression. Two records may have the same name, status, category, or other non-unique field.
- Use a unique item identifier. Prefer a property that distinguishes every item, such as
item.idoritem.uuid. If the data has no suitable identifier, Angular recommends considering adding one. See its control flow guide. - Check again after updates. The key must be unique across the full collection at each render, including after data changes.
For example, tracking a repeated display value can produce NG0955:
#1 Best Overall
@for (item of items; track item.value) {
{{ item.value }}
}
If item.key is unique for each item, track that instead:
@for (item of items; track item.key) {
{{ item.value }}
}
This follows the correction in Angular’s NG0955 example.
Rank #2
Which tracking expression should you use?
- Static collection: If the collection never changes, Angular describes
track $indexas a straightforward option. - Dynamic collection: For items that may be inserted, removed, or reordered, track a unique property that follows the logical item, such as an ID. An index identifies a position, not the item occupying it.
- No unique property available: Angular permits tracking the item itself by reference identity, but its guidance cautions that this can make rendering updates significantly slower. A stable domain identifier is preferable when available.
Angular’s @for API reference documents tracking options and the recommendation to use an item property for dynamic collections.
NG0955 versus NG0956
NG0955 is specifically about duplicate keys returned by a tracking expression. NG0956 concerns tracking by object identity in a way that causes Angular to recreate the DOM structure—for example, when immutable updates create new object instances for the same logical records. Both issues can be avoided by tracking a unique property such as an ID, but they describe different problems. See Angular’s NG0956 guide.
Rank #3
The NG0955-specific error page cited here is on Angular’s v18 documentation site; the API and control-flow guidance are on angular.dev. Consult the documentation for your Angular version if you need version-specific details.
Quick Recap
Rank #4
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.

