karma-runner/karma-chrome-launcher

Chrome headless lost WebGL support on MacOS

elalish opened this issue · 7 comments

Starting with Chrome 109, WebGL contexts can no longer be created in my Karma tests, meaning I can no longer run my tests locally. It appears to be because Chrome no longer supports software rendering on Arm-based macbooks, so the work-around is to enable the GPU instead: https://bugs.chromium.org/p/chromium/issues/detail?id=1407025#c9

I tried adding the indicated flags, but it's still not working because the launcher is also adding --disable-gpu:

'--disable-gpu',

Is there a reason the GPU should be disabled in headless mode? Is there a workaround for this, or can we remove this flag?

Getting Same Error. Can we expect the fix asap?

HarelM commented

Do you guys have a workaround? maybe patch-package? How did you solve this, I ran into this problem just now...

Karma got deprecated since I opened this, so I ended up switching to the modern web test runner instead. It's working great! My PR looks huge, but that was mostly other cleanup; you can see the new config here.

HarelM commented

So you switched from karma to playwright? Can you link to the karma deprecation article? Or are you saying that only this plugin got deprecated?

HarelM commented

THANKS!!

If you don't have a hard requirement for Chrome Headless, using regular Chrome will not have the WebGL issue.

I just did that (granted it uses more memory, but at least I can run my unit tests without switching unit test frameworks or manually patching a file inside node_modules/)