{"record":{"id":"9298ca1ea458d429","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-9298ca","errorCode":null,"errorMessage":"Failed to create WebGL vertex array","messagePattern":"Failed to create WebGL vertex array","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/light-leak.ts","lineNumber":256,"sourceCode":"\t\t\tpremultipliedAlpha: true,\n\t\t\talpha: true,\n\t\t\tpreserveDrawingBuffer: true,\n\t\t});\n\t\tif (!gl) {\n\t\t\tthrow createWebGL2ContextError('light leak effect');\n\t\t}\n\n\t\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\t\tconst vs = compileShader(gl, gl.VERTEX_SHADER, LIGHT_LEAK_VS);\n\t\tconst fs = compileShader(gl, gl.FRAGMENT_SHADER, LIGHT_LEAK_FS);\n\t\tconst program = linkProgram(gl, vs, fs);\n\t\tgl.deleteShader(vs);\n\t\tgl.deleteShader(fs);\n\n\t\tconst vao = gl.createVertexArray();\n\t\tif (!vao) {\n\t\t\tthrow new Error('Failed to create WebGL vertex array');\n\t\t}\n\n\t\tgl.bindVertexArray(vao);\n\n\t\tconst data = new Float32Array([\n\t\t\t-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,\n\t\t]);\n\n\t\tconst vbo = gl.createBuffer();\n\t\tif (!vbo) {\n\t\t\tthrow new Error('Failed to create WebGL buffer');\n\t\t}\n\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n\n\t\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\t\tconst aUv = gl.getAttribLocation(program, 'aUv');","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/light-leak.ts#L238-L274","documentation":"Thrown inside `lightLeak`'s setup when `gl.createVertexArray()` returns `null`. The light-leak VAO (capturing the fullscreen quad's position/UV attributes) could not be allocated, indicating context loss or GPU object-slot/memory exhaustion.","triggerScenarios":"Context lost before VAO creation; too many VAOs across concurrent effects; software renderer refusing a VAO; VRAM exhaustion.","commonSituations":"Concurrent renders; backgrounded tabs; memory-constrained environments.","solutions":["Lower concurrency and reuse/dispose VAOs.","Handle context loss and recreate the effect on restore.","Restart Chrome/GPU to clear leaked objects.","Use a GPU-backed render environment."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  lightLeak({...})(...);\n} catch (err) {\n  if (/Failed to create WebGL vertex array/.test(String(err))) {\n    console.warn('lightLeak() VAO unavailable', err);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Dispose VAOs on unmount to free object slots.","Keep concurrent WebGL2 contexts low.","Handle context loss and rebuild on restore."],"tags":["light-leak","webgl2","gpu","vao","context-loss","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}