{"record":{"id":"31bf78aa34fdb5cf","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-geometry","errorCode":null,"errorMessage":"Failed to create WebGL geometry","messagePattern":"Failed to create WebGL geometry","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/flannel.ts","lineNumber":240,"sourceCode":"\tif (!program) {\n\t\tthrow new Error('Failed to create WebGL program');\n\t}\n\n\tgl.attachShader(program, vertexShader);\n\tgl.attachShader(program, fragmentShader);\n\tgl.linkProgram(program);\n\tgl.deleteShader(vertexShader);\n\tgl.deleteShader(fragmentShader);\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst log = gl.getProgramInfoLog(program);\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(`Flannel program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\tconst vao = gl.createVertexArray();\n\tconst vbo = gl.createBuffer();\n\tif (!vao || !vbo) {\n\t\tthrow new Error('Failed to create WebGL geometry');\n\t}\n\n\tgl.bindVertexArray(vao);\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(\n\t\tgl.ARRAY_BUFFER,\n\t\tnew Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),\n\t\tgl.STATIC_DRAW,\n\t);\n\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');\n\tgl.enableVertexAttribArray(aPos);\n\tgl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);\n\tgl.enableVertexAttribArray(aUv);\n\tgl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);\n\tgl.bindVertexArray(null);\n\n\tconst texture = gl.createTexture();","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/flannel.ts#L222-L258","documentation":"Thrown by setupFlannel when gl.createVertexArray() or gl.createBuffer() returns null. Both return null only on context loss or severe resource exhaustion, indicating a GPU resource allocation failure for the fullscreen-quad geometry.","triggerScenarios":"Lost WebGL context before geometry allocation; many concurrent effects exhausting buffer/VAO object pools; software GL with strict object limits.","commonSituations":"Large compositions with dozens of WebGL layers; headless render under memory pressure; resumed after a GPU crash.","solutions":["Reduce the number of active WebGL effects.","Retry on a new Chrome instance.","Use a host with more GPU resources."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"let effect;\nfor (let attempt = 0; attempt < 3; attempt++) {\n  try {\n    effect = flannel(params);\n    break;\n  } catch (err) {\n    if (attempt === 2 || !/WebGL|geometry/i.test(String(err))) throw err;\n    await new Promise((r) => setTimeout(r, 200 * (attempt + 1)));\n  }\n}","preventionTips":["Reduce the number of concurrent WebGL effects to free VAO/VBO objects.","Render on a host with adequate GPU resources.","Retry after a fresh Chrome launch to clear transient context loss."],"tags":["webgl","flannel","gpu","geometry","runtime"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}