Kitware / vtk-js

Visualization Toolkit for the Web
https://kitware.github.io/vtk-js/
BSD 3-Clause "New" or "Revised" License
1.19k stars 368 forks source link

[Bug] Headless Chrome - Cannot read property 'blendFuncSeparate' of null #3004

Open will-3ds opened 6 months ago

will-3ds commented 6 months ago

Bug description

image Got an error "Uncaught TypeError: Cannot read property 'blendFuncSeparate' of null" launching page with headless Chromium. The page with the renderer works fine with a classic Chrome/Chromium browser. The command I use to run the headless is the following: chromium --disable-gpu --headless --no-sandbox --ignore-certificate-errors --disable-web-security --profile-directory=Profile 1 --disable-features=DefaultPassthroughCommandDecoder --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --verbose http://dev.local

Steps to reproduce

Detailed Behavior

No response

Expected Behavior

Page should render correctly

Environment

daker commented 6 months ago

Why are you disabling the gpu with --disable-gpu ?

will-3ds commented 6 months ago

Omitting --disable-gpu outputs this error ERROR:viz_main_impl.cc(150)] Exiting GPU process due to errors during initialization

daker commented 6 months ago

can you try this and upload the result? "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --ignore-gpu-blocklist --print-to-pdf=%userprofile%\Desktop\report-default.pdf chrome://gpu

Then this one "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --ignore-gpu-blocklist --use-angle=swiftshader --print-to-pdf=%userprofile%\Desktop\report-vulkan.pdf chrome://gpu

You can try other backends with --use-angle to see which one works for you, ex : d3d11on12 or vulkan

will-3ds commented 6 months ago

Here are the reports:

daker commented 6 months ago

@will-3ds You don't have any hardware acceleration here and it seems you are running Chromium from within WSL2 on Windows 11, maybe try with --enable-gpu --use-gl=egl to see it works for you.