remotion-dev/remotion · error · Error

Failed to create WebGL buffer

Error message

Failed to create WebGL buffer

What it means

In setupOutline(), gl.createBuffer() returned null while allocating the vertex buffer for the effect's fullscreen quad. As with the other WebGL creation failures, a null buffer object indicates a lost WebGL2 context or exhausted GPU resources, not a problem with the effect's parameters.

Source

Thrown at packages/effects/src/outline.ts:366

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

	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);

	const program = createProgram(gl);
	const vao = gl.createVertexArray();
	if (!vao) {
		throw new Error('Failed to create WebGL vertex array');
	}

	gl.bindVertexArray(vao);
	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,
		new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),
		gl.STATIC_DRAW,
	);

	const aPos = gl.getAttribLocation(program, 'aPos');
	const aUv = gl.getAttribLocation(program, 'aUv');
	gl.enableVertexAttribArray(aPos);
	gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);
	gl.enableVertexAttribArray(aUv);
	gl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);
	gl.bindVertexArray(null);

	const textureSource = createTexture(gl);

View on GitHub (pinned to 10db9de073)

Solutions

  1. Retry the render (fresh context usually succeeds)
  2. Reduce render concurrency so each Chrome profile holds fewer WebGL contexts
  3. Update Chrome/GPU drivers on the render host
  4. If reproducible on a single frame, minimize the composition and report it to Remotion
Defensive patterns

Strategy: retry

Try / catch

try {
  await renderMediaOnLambda(/* ... */);
} catch (err) {
  if (err instanceof Error && err.message === 'Failed to create WebGL buffer') {
    await renderMediaOnLambda(/* ..., concurrency: 2 */);
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: Applying outline() when the WebGL2 context is lost or GPU buffer allocation fails - commonly during high-concurrency renders with many live contexts or after a driver reset.

Common situations: Server/headless renders with many parallel effect frames; machines with failing GPU drivers; renders that run long enough to trigger context garbage-collection edge cases.

Related errors


AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22). Data as JSON: /api/errors/947180988c83c3b5. Report an issue: GitHub.