{"record":{"id":"73059483c8e630d4","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-730594","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/light-trail/light-trail-runtime.ts","lineNumber":116,"sourceCode":"};\n\nexport const setupLightTrail = (target: HTMLCanvasElement): LightTrailState => {\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('light trail effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, LIGHT_TRAIL_VS, LIGHT_TRAIL_FS);\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\tgl.enableVertexAttribArray(0);\n\tgl.vertexAttribPointer(0, 2, gl.FLOAT, false, 16, 0);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/light-trail/light-trail-runtime.ts#L98-L134","documentation":"Thrown when `gl.createVertexArray()` returns null during lightTrail setup. The VAO bundles the fullscreen-quad vertex format. Like other GL allocations, null only occurs on context loss or handle exhaustion.","triggerScenarios":"VAO handle exhaustion from many concurrent WebGL effects; setup called on an already-lost context; a driver limit on VAO objects reached.","commonSituations":"Dozens of effects each holding a VAO on the same context; headless Chromium leaking VAOs; render worker reusing a long-lived context.","solutions":["Share/cleanup state aggressively; pair every setup with cleanup.","Listen for and recover from `webglcontextlost`.","Reduce the number of simultaneously active WebGL effects per canvas.","Restart the render worker if a session shows progressive GL handle growth."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  setupLightTrail(canvas);\n} catch (err) {\n  // VAO exhaustion or context loss — degrade to non-effect render\n  renderWithoutEffect();\n}","preventionTips":["Limit the number of simultaneously active WebGL effects per canvas.","Always cleanup unused effect state.","Restart workers that accumulate GL handles."],"tags":["webgl","light-trail","effects","gpu","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}