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.

Solutions

  1. Read the logged violation strings and the %o element reference to find the offending host element
  2. Fix the underlying ARIA issue the violation describes (add required attributes/roles)
  3. 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

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


AI-assisted analysis of angular/components@0411926e7d (2026-08-31). Data as JSON: /api/errors/84abb97a6b9640ea. Report an issue: GitHub.

Appendix: 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)