GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28k stars 9.32k forks source link

Lighthouse emits incorrect `Values assigned to role="" are not valid ARIA roles.` message mismatching `axe-core` #16087

Closed TomerAberbach closed 6 days ago

TomerAberbach commented 1 week ago

FAQ

URL

https://tomeraberba.ch/avoid-layout-shifts-caused-by-web-fonts-with-postcss-fontpie

What happened?

Got this error:

Values assigned to role="" are not valid ARIA roles.

For the video elements on the page, which have role="img".

What did you expect?

I expected Lighthouse to say that role="img" is not allowed instead of saying something weird about role="".

I tested out what axe-core has to say about <video role="img"></video>, and it seems to give a proper message so I'm assuming that Lighthouse is doing something wrong:

Screenshot 2024-06-23 at 8 06 45 PM

I also confirmed that a minimal repro containing <video role="img"></video> still triggers the weird Lighthouse error.

What have you tried?

Seems pretty obvious that it's a Lighthouse bug. See above.

How were you running Lighthouse?

Chrome DevTools

Lighthouse Version

12.0.0

Chrome Version

Version 126.0.6478.114 (Official Build) (arm64)

Node Version

No response

OS

MacOS

Relevant log output

No response

adamraine commented 6 days ago

This should be fixed in the most recent Lighthouse update https://github.com/GoogleChrome/lighthouse/pull/16042