{"record":{"id":"2c3925813f4a4261","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-buffer-2c3925","errorCode":null,"errorMessage":"Failed to create WebGL buffer","messagePattern":"Failed to create WebGL buffer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/light-leak.ts","lineNumber":267,"sourceCode":"\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');\n\t\tgl.enableVertexAttribArray(aPos);\n\t\tgl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);\n\t\tgl.enableVertexAttribArray(aUv);\n\t\tgl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);\n\n\t\tgl.bindVertexArray(null);\n\n\t\tconst texture = gl.createTexture();\n\t\tif (!texture) {\n\t\t\tthrow new Error('Failed to create WebGL texture');\n\t\t}","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/light-leak.ts#L249-L285","documentation":"Thrown inside `lightLeak`'s setup when `gl.createBuffer()` returns `null`. The vertex buffer holding the fullscreen-quad data could not be allocated — context loss or GPU buffer memory/object-slot exhaustion.","triggerScenarios":"Context lost before buffer creation; many concurrent buffer allocations; VRAM exhaustion.","commonSituations":"Long-running or concurrent renders leaking GL buffers; constrained CI/Lambda; suspended tabs.","solutions":["Reduce concurrency and dispose unused GL buffers.","Handle context loss and recreate the effect.","Restart the GPU/Chrome process to reclaim leaked buffer objects.","Render with adequate video memory."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  lightLeak({...})(...);\n} catch (err) {\n  if (/Failed to create WebGL buffer/.test(String(err))) {\n    console.warn('lightLeak() VBO unavailable', err);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Dispose GL buffers between renders to prevent leaks.","Lower concurrency on constrained renderers.","Handle context-loss events before retrying."],"tags":["light-leak","webgl2","gpu","vbo","context-loss","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}