{"record":{"id":"a6fe5f07328264e8","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-a6fe5f","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/speckle.ts","lineNumber":231,"sourceCode":"\t\t\tpremultipliedAlpha: true,\n\t\t\talpha: true,\n\t\t\tpreserveDrawingBuffer: true,\n\t\t});\n\t\tif (!gl) {\n\t\t\tthrow createWebGL2ContextError('speckle effect');\n\t\t}\n\n\t\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\t\tconst vs = compileShader(gl, gl.VERTEX_SHADER, SPECKLE_VS);\n\t\tconst fs = compileShader(gl, gl.FRAGMENT_SHADER, SPECKLE_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');","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/speckle.ts#L213-L249","documentation":"In the speckle() setup, gl.createVertexArray() returned null, so the effect throws 'Failed to create WebGL vertex array'. Without a VAO the effect cannot bind its fullscreen-quad geometry, so setup aborts. A null VAO reflects a lost or resource-exhausted WebGL2 context, not a parameter error.","triggerScenarios":"Context loss or VAO exhaustion right after program linking in the speckle setup; exceeding the driver's bound on simultaneous vertex array objects because many WebGL2 effects are live at once.","commonSituations":"High render concurrency with numerous stacked WebGL2 effects; long renders leaking VAOs; headless or software-GPU environments with tight resource caps; driver reset mid-setup.","solutions":["Render with ANGLE (--gl=angle / chromiumOptions.gl='angle' / Studio OpenGL=angle).","Reduce concurrency and/or the number of WebGL2 effects per frame to free VAO slots.","Confirm the effect cleanup path (gl.deleteVertexArray) actually runs so resources are reclaimed.","Use a host with a conformant GPU and current drivers."],"exampleFix":"// before\nnpx remotion render main MyComp out.mp4 --concurrency=16\n// after\nnpx remotion render main MyComp out.mp4 --concurrency=4 --gl=angle","handlingStrategy":"try-catch","validationCode":"function webgl2Available(): boolean {\n  try {\n    return !!document.createElement('canvas').getContext('webgl2');\n  } catch {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await renderMedia({ composition, codec: 'h264', chromiumOptions: { gl: 'angle' }, concurrency: 4 });\n} catch (err) {\n  if (err instanceof Error && /Failed to create WebGL vertex array/.test(err.message)) {\n    console.error('speckle() VAO allocation failed (context lost/exhausted). Reduce concurrency/effects.', err);\n    throw err;\n  }\n  throw err;\n}","preventionTips":["Render with ANGLE and modest concurrency.","Limit stacked WebGL2 effects per frame.","Ensure effect cleanup runs so VAOs are released.","Use a host with a real GPU and current drivers."],"tags":["webgl","gpu","effects","speckle","geometry","context-loss"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}