[SalesForce] LWC1041: Static id values are not allowed in iterators. Id values must be unique within a template and must therefore be computed with an expression

I am getting this error:

LWC1041: Static id values are not allowed in iterators. Id values must be unique within a template and must therefore be computed with an expression.

In my Lightning Web Component.

I googled and couldnt find anything. Any one has any ideas what that means?

Its related to for:each iterator directive:

<template for:each={WA_ActivitiesData} for:item="activity">
<div class="activity activity--completed" key={activity.id}>

Best Answer

It was because of this id attribute on list item was static

<li id="activity-1-completed">
Related Topic