{"record":{"id":"84abb97a6b9640ea","repo":"angular/components","slug":"violations-found-on-element-o","errorCode":null,"errorMessage":"Violations found on element: %o:","messagePattern":"Violations found on element: %o:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/aria/private/utils/violations.ts","lineNumber":12,"sourceCode":"/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** Logs each of the violations to the console as errors, optionally with the host element context. */\nexport function reportViolations(violations: string[], element: Element): void {\n  if (violations.length) {\n    console.warn('Violations found on element: %o:', element);\n    violations.forEach(violation => {\n      console.warn(violation);\n    });\n  }\n}\n","sourceCodeStart":1,"sourceCodeEnd":18,"githubUrl":"https://github.com/angular/components/blob/0411926e7d8ae06b32236ec1048a888cfad5abf2/src/aria/private/utils/violations.ts#L1-L18","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const violations = checkAria(element);\nif (violations.length) reportViolations(violations, element); // only call when you expect to report","typeGuard":"function hasNoViolations(v: string[]): v is [] { return v.length === 0; }","tryCatchPattern":null,"preventionTips":["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"],"tags":["accessibility","aria","console-warning","dev-mode"],"backgroundTag":"aria-violation","analyzedSha":"0411926e7d8ae06b32236ec1048a888cfad5abf2","analyzedAt":"2026-08-31T11:58:23.400Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}