remotion-dev/remotion · error · Error

Failed to create WebGL buffer

Error message

Failed to create WebGL buffer

What it means

Internal error from the `rings()` effect setup: `gl.createBuffer()` returned `null` while allocating the vertex buffer that backs the fullscreen quad. Environment-level allocation failure — not user-param related. The buffer holds a fixed 16-float `Float32Array` (4 vertices × pos+uv), so the data size cannot be the cause.

Source

Thrown at packages/effects/src/rings.ts:372

	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);

	const program = createProgram(gl, RINGS_VS, RINGS_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');
	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 colorCanvas = document.createElement('canvas');
	colorCanvas.width = 1;
	colorCanvas.height = 1;
	const colorCtx = colorCanvas.getContext('2d', {willReadFrequently: true});

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Reload the page or restart the render.
  2. Reduce concurrent effect count.
  3. Update drivers / use hardware acceleration.
  4. Add context-loss handling so buffers are freed and re-allocated on restore.
Defensive patterns

Strategy: try-catch

Validate before calling

const canAllocateBuffer = (): boolean => {
  try {
    const c = document.createElement('canvas');
    const gl = c.getContext('webgl2');
    if (!gl) return false;
    const b = gl.createBuffer();
    if (b) gl.deleteBuffer(b);
    return !!b;
  } catch {
    return false;
  }
};

Try / catch

try {
  rings()({...});
} catch (err) {
  if (err instanceof Error && /Failed to create WebGL buffer/.test(err.message)) {
    // reduce active effects and retry
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: WebGL2 context lost between VAO creation and buffer creation; GPU buffer object limit reached from many effects; software GL backend with strict buffer caps.

Common situations: Heavy compositions in Studio; CI on memory-starved GPU runners; systems recovering from a GPU process crash.

Related errors


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