{"record":{"id":"8824adb8eadde295","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-8824ad","errorCode":null,"errorMessage":"Failed to create WebGL vertex array","messagePattern":"Failed to create WebGL vertex array","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/linear-gradient-tint.ts","lineNumber":285,"sourceCode":"const setupLinearGradientTint = (\n\ttarget: HTMLCanvasElement,\n): LinearGradientTintState => {\n\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('linear gradient tint effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl);\n\n\tconst vao = gl.createVertexArray();\n\tif (!vao) {\n\t\tthrow new Error('Failed to create WebGL vertex array');\n\t}\n\n\tgl.bindVertexArray(vao);\n\n\tconst data = new Float32Array([\n\t\t-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,\n\t]);\n\n\tconst vbo = gl.createBuffer();\n\tif (!vbo) {\n\t\tthrow new Error('Failed to create WebGL buffer');\n\t}\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n\n\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/linear-gradient-tint.ts#L267-L303","documentation":"Thrown when `gl.createVertexArray()` returns null during linearGradientTint setup. The VAO encapsulates the fullscreen-quad attrib layout. Null only occurs under context loss or VAO-handle exhaustion.","triggerScenarios":"Many concurrent WebGL effects exhausting VAO handles; setup on a lost context; constrained driver VAO limits reached.","commonSituations":"Dozens of stacked effects per frame; long-lived workers; headless Chromium leaking VAOs.","solutions":["Pair setup with cleanup and reuse cached state.","Recover on `webglcontextlost`/`webglcontextrestored`.","Reduce simultaneously active WebGL effects.","Restart workers showing GL handle growth."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  setupLinearGradientTint(canvas);\n} catch (err) {\n  renderWithoutEffect();\n}","preventionTips":["Limit simultaneously active WebGL effects per canvas.","Always cleanup unused effect state.","Restart workers that accumulate GL handles."],"tags":["webgl","linear-gradient-tint","effects","gpu","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}