{"record":{"id":"4252161174331c53","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-425216","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/corner-pin/corner-pin-runtime.ts","lineNumber":109,"sourceCode":"};\n\nexport const setupCornerPin = (target: HTMLCanvasElement): CornerPinState => {\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('corner pin effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, CORNER_PIN_VS, CORNER_PIN_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":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/corner-pin/corner-pin-runtime.ts#L91-L127","documentation":"Thrown in setupCornerPin when gl.createVertexArray() returns null. The WebGL2 context was acquired but could not allocate a VAO. This is a GPU resource exhaustion or context-loss issue internal to corner-pin setup.","triggerScenarios":"During corner-pin effect initialization, after the shader program is created, gl.createVertexArray() returns null.","commonSituations":"Too many VAOs across concurrent effects; context lost; GPU memory pressure; constrained software WebGL in headless/CI/VM environments.","solutions":["Reduce concurrent WebGL effects to lower VAO allocation.","Verify context health with gl.isContextLost().","Use a GPU-capable rendering environment.","Handle webglcontextlost for recovery."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify WebGL2 context health before corner pin setup\nconst gl = target.getContext('webgl2');\nif (gl?.isContextLost()) {\n  // defer or skip\n}","typeGuard":null,"tryCatchPattern":"try {\n  cornerPin({...})(source, target);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Failed to create WebGL vertex array') {\n    // GPU resource issue — reduce concurrent effects\n  }\n  throw e;\n}","preventionTips":["Reduce concurrent WebGL effects to lower VAO allocation.","Check gl.isContextLost() before effect setup.","Use a GPU-capable rendering environment.","Handle webglcontextlost events."],"tags":["webgl","effects","corner-pin","gpu","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}