Cause: Sigma.js fails to initialize WebGL because the browser reports a null WebGLRenderingContext. The blendFunc call happens during WebGL setup.
Common reasons:
- Browser or GPU WebGL disabled — older Safari versions, privacy modes, or hardware acceleration off.
- Cross-origin iframe — WebGL blocked by CSP or sandbox flags.
- Sigma fallback bug — if WebGL creation returns
null, Sigma still assumes success instead of falling back to canvas.
Check:
const canvas = document.createElement('canvas');
const gl = canvas.getContext('webgl');
console.log(gl ? 'WebGL ok' : 'WebGL unavailable');
Fix options:
-
Before creating the renderer, test for WebGL:
if (!window.WebGLRenderingContext || !document.createElement('canvas').getContext('webgl')) {
alert('WebGL not supported in this browser');
return;
}
new sigma({ ... });
-
Or force Sigma to use the canvas renderer if WebGL fails:
try {
renderer = new sigma.Renderer({ container, type: 'webgl' });
} catch {
renderer = new sigma.Renderer({ container, type: 'canvas' });
}
Cause: Sigma.js fails to initialize WebGL because the browser reports a null
WebGLRenderingContext. TheblendFunccall happens during WebGL setup.Common reasons:
null, Sigma still assumes success instead of falling back to canvas.Check:
Fix options:
Before creating the renderer, test for WebGL:
Or force Sigma to use the canvas renderer if WebGL fails: