Wave tool used to evaluate web content for accessibility issues giving Broken ARIA reference errors I am trying to fix Broken ARIA reference errors notified by Wave tool in chrome for my custom module web pages and Drupal 8 core login form. Sample error in login form is mentioned below for username field. How to fix these issues. For every user control I have this site wide.

Error at username text box:

*aria-describedby="edit-name--description", aria-required="true"

(An aria-labelledby or aria-describedby reference exists, but the target for the reference does not exist.)

I am not able to find aria-describedby attribute itself in the code for the controls. So, I am not sure how to fix them.
The attribute is only added if the element has a description. This is the code from the FormBuilder that does it:

// Add the aria-describedby attribute to associate the form control with its
// description.
if (!empty($element['#description'])) {
  $element['#attributes']['aria-describedby'] = $element['#id'] . '--description';
}


The idea being that when the input is rendered in form-element.html.twig, the description is rendered alongside it with a matching ID. For example this is how the core stable theme handles it:

{% if description_display in ['after', 'invisible'] and description.content %}
  &lt;div{{ description.attributes.addClass(description_classes) }}&gt;
    {{ description.content }}
  &lt;/div&gt;
{% endif %}


So it seems likely there aren't that many possible sources for the problem. These are the only ones I could come up with:


You're using a core theme, or a derivative of one which still renders the description in form-element.html.twig, and something in the system is setting the description display to a value other than 'after' and 'invisible', causing it not to be rendered.
You're using a non-core theme, which overrides form-element.html.twig, and doesn't render the description.
Something in the system is changing either the value in the input's aria-describedby attribute, or the ID of the description element in the element template, causing them not to match.
Some combination of the above.


Hopefully that's enough to go on.