stackgl / headless-gl

🎃 Windowless WebGL for node.js
1.73k stars 166 forks source link

Set up on NixOS: `Error creating WebGLContext` #283

Open UlyssesZh opened 3 months ago

UlyssesZh commented 3 months ago

This was talked about in #277 without a satisfying solution.

nix-shell -p nodejs cairo gcc pkg-config xorg.libXi libGLU glew xvfb-run
npm i gl
xvfb-run -s '-ac -screen 0 1280x1024x24' node -e 'new (require("gl").WebGLRenderingContext)(1,1,true,true,false,false,true,false,false,false)'
/home/ulysses/temp/test-gl/node_modules/gl/src/javascript/webgl-rendering-context.js:98
class WebGLRenderingContext extends NativeWebGLRenderingContext {
^
Error: Error creating WebGLContext
    at new WebGLRenderingContext (/home/ulysses/temp/test-gl/node_modules/gl/src/javascript/webgl-rendering-context.js:98:1)

Has the same phenomenon as #262.

Wrap the node command with steam-run fixes this, but this can just be a temporary workaround.