remotion-dev/remotion · error · Error

Failed to create WebGL buffer

Error message

Failed to create WebGL buffer

What it means

Thrown by setupVignette when gl.createBuffer() returns null. The vertex buffer carries the fullscreen-quad geometry used by the vignette shader; without it the pass cannot run. A null return means context loss or GL object/memory exhaustion.

Source

Thrown at packages/effects/src/vignette.ts:359

	}

	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);

	const program = createProgram(gl, VIGNETTE_VS, VIGNETTE_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);

	gl.enableVertexAttribArray(0);
	gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 16, 0);
	gl.enableVertexAttribArray(1);
	gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 16, 8);

	gl.bindVertexArray(null);

	const textureSource = createRgbaTexture(gl);
	const colorCanvas = document.createElement('canvas');
	colorCanvas.width = 1;
	colorCanvas.height = 1;
	const colorCtx = colorCanvas.getContext('2d', {willReadFrequently: true});
	if (!colorCtx) {

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Reload to reset the context and release buffers.
  2. Reduce concurrent WebGL effects.
  3. Verify hardware-accelerated WebGL2 and update drivers.
  4. Dispose offscreen effects to free GL objects.

Example fix

// before
const effect = vignette({amount: 0.6});

// after
const effect = (() => {
  try { return vignette({amount: 0.6}); } catch { return null; }
})();
Defensive patterns

Strategy: try-catch

Try / catch

let effect = null;
try {
  effect = vignette({amount: 0.6});
} catch (err) {
  console.warn('vignette VBO alloc failed, skipping effect', err);
}

Prevention

When it happens

Trigger: setupVignette calls gl.createBuffer() after binding the VAO; it returns null because the context is lost or the buffer-object budget is hit.

Common situations: Context loss under heavy effect load; GPU memory pressure; headless Chrome limits.

Related errors


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