Self-Correction
Invalid enum values log structured errors in development. Validation does not throw and is omitted from production builds.
The error shape
{
"component": "Button",
"error": "INVALID_PROP_VALUE",
"prop": "variant",
"received": "success",
"valid_values": ["primary", "secondary", "tertiary", "danger", "ghost"],
"suggestion": "'success' is not a Button variant. Use variant='primary' for positive actions, or a Badge (variant='success') to display status."
}
How an agent uses it
- Read
valid_values— the allowed set for that prop. - Read
suggestion— often a direct redirect (e.g. useBadgeinstead). - Replace the value and re-render.
valid_values comes from the manifest.
What it does not reach
These errors appear in a browser console, for option values only. An agent working in a terminal never sees them. operator-ds check reads the source instead: it reports the same invalid values with their file and line, and also nesting, required props and the house rules.