{"record":{"id":"d4cdc08d4861a00d","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-d4cdc0","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/checkerboard.ts","lineNumber":362,"sourceCode":"};\n\nconst setupCheckerboard = (target: HTMLCanvasElement): CheckerboardState => {\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('checkerboard effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, CHECKERBOARD_VS, CHECKERBOARD_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\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/checkerboard.ts#L344-L380","documentation":"Thrown by setupCheckerboard() when gl.createVertexArray() returns null. The VAO holds the quad's vertex attribute bindings for the checkerboard shader; a null return means the context is lost, destroyed, or out of VAO objects, so the effect cannot configure its draw call and setup aborts.","triggerScenarios":"setupCheckerboard() calls gl.createVertexArray() at checkerboard.ts:360 after program creation; it returns null and the guard at :361 throws.","commonSituations":"Lost/destroyed GL2 context, GPU process crash, too many VAOs across live compositions, or software rendering under pressure.","solutions":["Reduce concurrent WebGL-using effects/compositions.","Enable GPU acceleration in the browser.","Recreate the effect on 'webglcontextrestored' after a loss.","Update GPU drivers; verify VAO support via WebGL2.","Use a GPU-enabled/higher-memory render instance."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"function probeWebGL2(): boolean {\n  try {\n    const c = document.createElement('canvas');\n    const gl = c.getContext('webgl2');\n    if (!gl) return false;\n  const vao = gl.createVertexArray();\n  const ok = !!vao;\n  if (vao) gl.deleteVertexArray(vao);\n  return ok && !gl.isContextLost();\n  } catch {\n  return false;\n  }\n}\nif (!probeWebGL2()) skipOrFallback();","typeGuard":null,"tryCatchPattern":"try {\n  return <Checkerboard {...props} />;\n} catch (err) {\n  if (/Failed to create WebGL vertex array/.test(String(err))) return <FallbackFrame />;\n  throw err;\n}","preventionTips":["Reduce concurrent WebGL-using effects to stay within VAO budgets.","Enable GPU acceleration.","Recreate the effect after 'webglcontextrestored'.","Update GPU drivers and verify VAO support."],"tags":["webgl","gpu","vao","effects","checkerboard","rendering"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}