{"record":{"id":"0ea9083f2c482c62","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-0ea908","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/duotone.ts","lineNumber":218,"sourceCode":"};\n\nconst setupDuotone = (target: HTMLCanvasElement): DuotoneState => {\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('duotone effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, DUOTONE_VS, DUOTONE_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":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/duotone.ts#L200-L236","documentation":"Thrown by setupDuotone() when gl.createVertexArray() returns null right after the shader program was built. A null VAO means the WebGL2 implementation refused to allocate a vertex-array object, which per spec only happens on a lost context or resource exhaustion.","triggerScenarios":"First-frame setup of duotone() on a Chrome GPU process that has lost the context or hit its object limit before the geometry VAO could be created.","commonSituations":"Headless/CI Chrome without a healthy GPU, too many concurrent WebGL2 contexts, a driver reset during render.","solutions":["Render with a software backend: `npx remotion render <comp> --gl=swiftshader`.","Reduce concurrency so the per-frame context is not starved.","Restart the render worker to clear a lost context.","Update the GPU driver / Chromium build."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"async function safeRender(opts) {\n  try {\n    return await renderMedia(opts);\n  } catch (err) {\n    if (/Failed to create WebGL vertex array/.test(String(err?.message ?? ''))) {\n      return await renderMedia({...opts, gl: 'swiftshader', concurrency: 1});\n    }\n    throw err;\n  }\n}","preventionTips":["Render with a software GL backend when the GPU is unreliable.","Cap concurrency so each frame's WebGL objects fit within the GPU budget.","Relaunch Chrome / the render worker to recover from a lost context.","Update the GPU driver / Chromium build."],"tags":["webgl","gpu","rendering","effects","runtime"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}