{"record":{"id":"2a1fe832c55d2995","repo":"perspective-dev/perspective","slug":"webgl-is-not-supported","errorCode":null,"errorMessage":"WebGL is not supported","messagePattern":"WebGL is not supported","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/viewer-charts/src/ts/webgl/gl-context.ts","lineNumber":82,"sourceCode":"        this._precompile = options.precompile ?? false;\n        const gl2 = canvas.getContext(\"webgl2\", {\n            antialias: true,\n            alpha: true,\n            premultipliedAlpha: false,\n        });\n\n        if (gl2) {\n            this.gl = gl2 as WebGL2RenderingContext;\n            this.isWebGL2 = true;\n        } else {\n            const gl1 = canvas.getContext(\"webgl\", {\n                antialias: true,\n                alpha: true,\n                premultipliedAlpha: false,\n            });\n\n            if (!gl1) {\n                throw new Error(\"WebGL is not supported\");\n            }\n\n            this.gl = gl1 as WebGLRenderingContext;\n            this.isWebGL2 = false;\n        }\n\n        this.shaders = new ShaderRegistry(this.gl);\n        if (this._precompile) {\n            this.shaders.precompile(SHADER_MANIFEST);\n        }\n\n        this._maxVertexAttribs = this.gl.getParameter(\n            this.gl.MAX_VERTEX_ATTRIBS,\n        ) as number;\n        if (!this.isWebGL2) {\n            this._angle = this.gl.getExtension(\"ANGLE_instanced_arrays\");\n        }\n","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/perspective-dev/perspective/blob/11c8238c0c9c0b9e490b5a6a2dc277afad1e980a/packages/viewer-charts/src/ts/webgl/gl-context.ts#L64-L100","documentation":"The WebGL context manager tries webgl2 first, then webgl1; when the browser/environment (headless browser, disabled hardware acceleration, exhausted context limit) returns null from both getContext calls, no rendering surface exists and the constructor aborts. This is an environment-capability failure, not bad input.","triggerScenarios":"Thrown at packages/viewer-charts/src/ts/webgl/gl-context.ts:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable hardware acceleration or run in a browser with WebGL support","Check for too many live WebGL contexts (browsers cap ~8–16); release unused canvases","In headless/CI environments, launch with GPU-enabled flags (e.g. --use-gl=swiftshader) or render server-side"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"11c8238c0c9c0b9e490b5a6a2dc277afad1e980a","analyzedAt":"2026-09-09T00:35:19.377Z","contentChangedAt":"2026-09-09T00:35:19.377Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}