lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Accessibility error: Failed to execute 'getImageData' on 'CanvasRenderingContext2D'

Open AmandaJaneDesign opened this issue 3 years ago • 14 comments

When I run lighthouse, it is flashing this Chrome services page for like .2 seconds and it is messing up my scores. The Accessibility is getting a "?" Question mark. I can't figure this out and I need to test sites for work. Please help

IMG_1082 Screenshot 2023-04-20 at 3 44 01 PM

AmandaJaneDesign avatar Apr 20 '23 19:04 AmandaJaneDesign

Lighthouse is navigating to the chrome://terms page intentionally, it should not affect your scores. Could you please provide a URL that reproduces this problem?

adamraine avatar Apr 20 '23 20:04 adamraine

Hi! i'm one of the Google developers for cloud.google.com. We're unable to run our a11y reports ever since 10.0.0 became the standard version for lightrider. I'm also experiencing the same behavior as noted above for every url i've tested on cloud.google.com. Can we escalate this priority?

edit for clarity - after more testing, several of my urls on cloud.google.com are fine, but some are not, and i don't see a strong connection to which ones work and which ones don't.

TripleEquals avatar Apr 21 '23 17:04 TripleEquals

Talked to @TripleEquals offline, URL to repro: https://cloud.google.com/gcp

It seems like the color-contrast audit is failing, with the following error:

    "color-contrast": {
      "id": "color-contrast",
      "title": "Background and foreground colors have a sufficient contrast ratio",
      "description": "Low-contrast text is difficult or impossible for many users to read. [Learn how to provide sufficient color contrast](https://dequeuniversity.com/rules/axe/4.6/color-contrast).",
      "score": null,
      "scoreDisplayMode": "error",
      "errorMessage": "axe-core Error: `TypeError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': Value is not of type 'long'.` - feature unsupported in your environment. Skipping color-contrast rule."
    },

Does having a null color-contrast score block calculating the overall a11y score?

jazyan avatar Apr 21 '23 18:04 jazyan

Thanks @TripleEquals @jazyan, I can reproduce this!

Does having a null color-contrast score block calculating the overall a11y score?

Yes, since we can't calculate a score for this specific audit we can't get the overall a11y score. That being said, it might be worth treating axe-core errors like these as score: 0 rather than score: null.

Either way, we should investigate and fix this specific error.

adamraine avatar Apr 21 '23 18:04 adamraine

https://github.com/dequelabs/axe-core/issues/3918

connorjclark avatar Apr 21 '23 19:04 connorjclark

@adamraine @connorjclark axe-core has merged the following PR to address this issue,

https://github.com/dequelabs/axe-core/issues/3918 PR: https://github.com/dequelabs/axe-core/pull/4103

Could you please check and do the needful?

mhaneef50673 avatar Aug 26 '23 05:08 mhaneef50673

The PR has landed but it hasn't been officially released yet

adamraine avatar Aug 28 '23 16:08 adamraine

Hi guys, long time listener first time caller. I am getting the same issue on mobile only for one of my client's sites. I can't figure out what is going with it. Any help would be appreciated.

Maverick737800 avatar Aug 31 '23 14:08 Maverick737800

Thanks, but not sure what any of that means? I get this error:

Background and foreground colors have a sufficient contrast ratio Error! Low-contrast text is difficult or impossible for many users to read. [Learn how to provide sufficient color contrast]

But I have made sure everything on the site is within the ratio.

Thanks for your help again.

Maverick737800 avatar Aug 31 '23 21:08 Maverick737800

@Maverick737800 The current state is that we are working on pulling in a new release of axe that will fix this issue. It's been mentioned right above your comment.

connorjclark avatar Aug 31 '23 21:08 connorjclark

Yeah ok cool. Thanks a lot. Had no idea what this really meant as I'm still new to the game. Thanks.

Maverick737800 avatar Aug 31 '23 21:08 Maverick737800

Hi, Not sure if this can help, but I have the same issue:

_CONTRAST
Background and foreground colors have a sufficient contrast ratio **Error**!
axe-core Error: `TypeError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': Value is not of type 'long'.` - feature unsupported in your environment. Skipping color-contrast rule_
  • This happens with Lighthouse 10.1.0 to 10.4.0 and linux system
  • It works correctly when using windows system (_Background and foreground colors do not have a sufficient contrast ratio_)
  • It was working fine on both systems with Lighthouse 9.3.0

Forcing the usage of [email protected] fixes the error but the Contrast 'Failing Elements' reported list is smaller when using linux than when using windows. It seems that Unicode string are not well handled on axe-core when using linux platform.

Seen on https://www.maybelline.com.hk/zh-hk/eye

Any idea how to fix it for linux?

moulinette avatar Sep 08 '23 09:09 moulinette

Forcing the usage of [email protected] fixes the error but the Contrast 'Failing Elements' reported list is smaller when using linux than when using windows. It seems that Unicode string are not well handled on axe-core when using linux platform.

We just updated axe-core to 4.8.0 in the latest Lighthouse version 11.1. I can't reproduce this issue.

Please verify that the issue still happens on your end and fill out a new bug report if it does.

adamraine avatar Sep 08 '23 22:09 adamraine

hi, it has the same issue for this url: https://vnggames.com image

trieu-hphuc96 avatar Nov 29 '23 10:11 trieu-hphuc96