AUR0816
Error Message
AUR0816: Invalid [default-case] usage. Multiple 'default-case's are not allowed.
Description
This error occurs during template compilation/linking when an element using the switch attribute has more than one direct child element marked with the default-case attribute.
Cause
The switch controller allows for multiple case attributes, each matching a specific value. However, it permits only zero or one default-case attribute to handle scenarios where none of the specific case values match the value bound to switch. This error indicates that you have provided more than one default-case within the same switch block.
Solution
Ensure that within any given switch block, there is at most one element marked with the default-case attribute.
Remove Extra
default-case: Review the children of theswitchelement and remove all but onedefault-caseattribute.Combine Logic: If you need complex default logic, place it within a single
default-caseelement or<template default-case>.Use
caseInstead: If a condition was mistakenly marked asdefault-case, change it to a specificcase="someValue"if appropriate.
Example
Debugging Tips
Carefully review all direct children of the element with the
switchattribute.Count the number of children that have the
default-caseattribute; ensure the count is 0 or 1.Check for typos that might have accidentally resulted in multiple
default-caseattributes (e.g., copy-paste errors).
Last updated
Was this helpful?