remotion-dev/remotion · error · Error

Failed to create WebGL vertex array

Error message

Failed to create WebGL vertex array

What it means

Thrown by setupEmboss() when gl.createVertexArray() returns null right after the program was linked. The shaders and program succeeded, so a null VAO means the driver could not allocate a vertex-array object, per spec indicating a lost context or resource exhaustion.

Source

Thrown at packages/effects/src/emboss.ts:324

		premultipliedAlpha: true,
		alpha: true,
		preserveDrawingBuffer: true,
	});
	if (!gl) {
		throw createWebGL2ContextError('emboss effect');
	}

	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);

	const vs = compileShader(gl, gl.VERTEX_SHADER, EMBOSS_VS);
	const fs = compileShader(gl, gl.FRAGMENT_SHADER, EMBOSS_FS);
	const program = linkProgram(gl, vs, fs);
	gl.deleteShader(vs);
	gl.deleteShader(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 emboss() on a Chrome GPU process that has lost the context or hit its VAO budget before the geometry could be set up.

Common situations: Headless/CI Chrome without a healthy GPU, too many concurrent WebGL2 contexts, or a driver reset during render.

Related errors


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