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

  1. Render with a software backend: `npx remotion render <comp> --gl=swiftshader`.
  2. Reduce concurrency so the per-frame context is not starved.
  3. Restart the render worker to clear a lost context.
  4. 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

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


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/0ea9083f2c482c62. Report an issue: GitHub.