remotion-dev/remotion · critical · Error

Failed to create WebGL buffer

Error message

Failed to create WebGL buffer

What it means

The radial-progressive-blur runtime allocates a vertex buffer object (VBO) for the fullscreen-quad vertex data via gl.createBuffer(). If the WebGL2 context returns null, the effect cannot upload geometry and must abort setup. This indicates context loss or resource exhaustion.

Source

Thrown at packages/effects/src/radial-progressive-blur/radial-progressive-blur-runtime.ts:163

		gl,
		RADIAL_PROGRESSIVE_BLUR_VS,
		buildRadialProgressiveBlurFs('vertical'),
	);

	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 textureIntermediate = createRgbaTexture(gl);

	const framebuffer = gl.createFramebuffer();
	if (!framebuffer) {
		throw new Error('Failed to create WebGL framebuffer');

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Handle 'webglcontextlost'/'webglcontextrestored' and re-run setup after restoration
  2. Ensure each effect's resources are disposed when the effect is removed
  3. Lower the number of simultaneous GPU effects in the composition
  4. Use a fresh Headless Chrome instance if the current one has accumulated GL state corruption
Defensive patterns

Strategy: retry

Try / catch

canvas.addEventListener('webglcontextlost', (e) => { e.preventDefault(); }, false);
canvas.addEventListener('webglcontextrestored', () => {
  // re-initialize effects, re-creating VBOs
}, false);

Prevention

When it happens

Trigger: Calling setupRadialProgressiveBlur() on a lost/exhausted context, or when the GL object pool has been depleted by leaking buffers from other effects.

Common situations: Long render sessions with gradual GL object leaks; headless Chrome under memory pressure; integrated GPUs with tight resource limits; many concurrent WebGL2 effects in one composition.

Related errors


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