angular/components · warning
Violations found on element: %o:
Error message
Violations found on element: %o:
What it means
This is a dev-time accessibility reporting helper from the Aria package: when element checkers find ARIA violations, reportViolations logs them to the console. Note that despite the message text, the implementation uses console.warn, not console.error.
Source
Thrown at src/aria/private/utils/violations.ts:12
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
/** Logs each of the violations to the console as errors, optionally with the host element context. */
export function reportViolations(violations: string[], element: Element): void {
if (violations.length) {
console.warn('Violations found on element: %o:', element);
violations.forEach(violation => {
console.warn(violation);
});
}
}
View on GitHub (pinned to 0411926e7d)
Solutions
- Read the logged violation strings and the %o element reference to find the offending host element
- Fix the underlying ARIA issue the violation describes (add required attributes/roles)
- If these are third-party component warnings, suppress in production by ensuring checks only run in dev mode
Defensive patterns
Strategy: validation
Validate before calling
const violations = checkAria(element); if (violations.length) reportViolations(violations, element); // only call when you expect to report
Type guard
function hasNoViolations(v: string[]): v is [] { return v.length === 0; } Prevention
- Run aria checker validations in dev builds only
- Fix logged violations immediately instead of suppressing
- Keep ARIA attributes in sync with component disabled/readonly state
When it happens
Trigger: An element is validated (e.g. by an Aria umbrella/disabled checker calling reportViolations from its constructor) and the violations array is non-empty, so each violation string plus the host element is logged.
Common situations: Running the Aria accessibility checkers on elements with missing ARIA attributes (e.g. disabled elements without aria-disabled wiring); seeing this during development with strict a11y checks enabled.
Related errors
- Detected a matBadge on an "aria-hidden" "<mat-icon>". Consid
- Cannot retrieve popup content because the combobox is closed
- Maps event target that uses native events must have `addEven
- Unsupported MatButton appearance "${appearance}"
- A mat-tab-nav-panel must be specified via [tabPanel].
AI-assisted analysis of angular/components@0411926e7d (2026-08-31).
Data as JSON: /api/errors/84abb97a6b9640ea.
Report an issue: GitHub.