{"record":{"id":"3b49724fe3a239ca","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-3b4972","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/chromatic-aberration/chromatic-aberration-runtime.ts","lineNumber":114,"sourceCode":"\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('chromatic aberration effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(\n\t\tgl,\n\t\tCHROMATIC_ABERRATION_VS,\n\t\tCHROMATIC_ABERRATION_FS,\n\t);\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":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/chromatic-aberration/chromatic-aberration-runtime.ts#L96-L132","documentation":"Thrown by setupChromaticAberration() when gl.createVertexArray() returns null. The VAO holds the quad's vertex attribute bindings (aPos/aUv at locations 0/1); a null return means the context is lost/destroyed or out of VAO objects, so the draw path cannot be configured and setup aborts.","triggerScenarios":"setupChromaticAberration() calls gl.createVertexArray() at chromatic-aberration-runtime.ts:112 after program creation; it returns null and the guard at :113 throws.","commonSituations":"Lost/destroyed GL2 context, GPU process crash, 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 <ChromaticAberration {...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","chromatic-aberration","rendering"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}