remotion-dev/remotion · error · Error
Failed to create WebGL vertex array
Error message
Failed to create WebGL vertex array
What it means
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.
Source
Thrown at packages/effects/src/duotone.ts:218
};
const setupDuotone = (target: HTMLCanvasElement): DuotoneState => {
const gl = target.getContext('webgl2', {
premultipliedAlpha: true,
alpha: true,
preserveDrawingBuffer: true,
});
if (!gl) {
throw createWebGL2ContextError('duotone effect');
}
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
const program = createProgram(gl, DUOTONE_VS, DUOTONE_FS);
const vao = gl.createVertexArray();
if (!vao) {
throw new Error('Failed to create WebGL vertex array');
}
gl.bindVertexArray(vao);
const data = new Float32Array([
-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,
]);
const vbo = gl.createBuffer();
if (!vbo) {
throw new Error('Failed to create WebGL buffer');
}
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
const aPos = gl.getAttribLocation(program, 'aPos');
const aUv = gl.getAttribLocation(program, 'aUv');View on GitHub (pinned to 78fe4bb3fd)
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.
Defensive patterns
Strategy: try-catch
Try / catch
async function safeRender(opts) {
try {
return await renderMedia(opts);
} catch (err) {
if (/Failed to create WebGL vertex array/.test(String(err?.message ?? ''))) {
return await renderMedia({...opts, gl: 'swiftshader', concurrency: 1});
}
throw err;
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Headless/CI Chrome without a healthy GPU, too many concurrent WebGL2 contexts, a driver reset during render.
Related errors
- Failed to create WebGL shader
- Failed to create WebGL program
- Failed to create WebGL texture
- Failed to create WebGL buffer
- Failed to create WebGL shader
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/0ea9083f2c482c62.
Report an issue: GitHub.