AUR0177
Error Message
AUR0177: Expression error: object binding patterns only support identifiers and aliases with unique, non-reserved local names: "{{expression}}"
Description
Object destructuring in a repeat.for declaration supports shallow property names and aliases whose targets are unique local identifiers. Aurelia reports this error when a parsed object declaration uses a nested pattern, an expression target, the same local name more than once, a repeat contextual name such as $index, the reserved $item name, or an Object prototype name such as constructor. Source properties with reserved names remain available through a safe alias.
Example Trigger
<!-- ❌ Nested object patterns are not supported -->
<div repeat.for="{ customer: { name } } of orders">
${name}
</div>Solution
Use shallow locals or repeat the complete object when the template needs more complex access:
<!-- ✅ Shallow property and alias -->
<div repeat.for="{ id: orderId, customer } of orders">
${orderId}: ${customer.name}
</div>
<!-- ✅ A reserved source property can use a safe local alias -->
<div repeat.for="{ constructor: type } of orders">
${type}
</div>
<!-- ✅ Keep the complete object -->
<div repeat.for="order of orders">
${order.id}: ${order.customer.name}
</div>Last updated
Was this helpful?