remotion-dev/remotion · critical · Error

Failed to create WebGL vertex array

Error message

Failed to create WebGL vertex array

What it means

During zoomBlur setup, `gl.createVertexArray()` returned `null`, meaning the WebGL2 context could not allocate a VAO. This is a resource-exhaustion or context-loss condition. The VAO stores the effect's fullscreen-quad vertex attribute bindings.

Source

Thrown at packages/effects/src/zoom-blur/zoom-blur-runtime.ts:107

	return texture;
};

export const setupZoomBlur = (target: HTMLCanvasElement): ZoomBlurState => {
	const gl = target.getContext('webgl2', {
		premultipliedAlpha: true,
		alpha: true,
		preserveDrawingBuffer: true,
	});
	if (!gl) {
		throw createWebGL2ContextError('zoom blur effect');
	}

	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);

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

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Reduce concurrent WebGL effects in the composition.
  2. Handle `webglcontextlost` and re-setup the effect.
  3. Update GPU drivers.
  4. Render on a machine with a more capable GPU.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  zoomBlur({ amount: 40 });
} catch (err) {
  if (err instanceof Error && err.message.includes('vertex array')) {
    console.error('VAO creation failed:', err.message);
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: WebGL2 context lost before VAO creation, GPU object limit reached from many concurrent effects, or a driver in a degraded state.

Common situations: Many simultaneous WebGL effect instances in one render, context loss after GPU crash, or environments with limited WebGL2 object quotas.

Related errors


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