remotion-dev/remotion · error · Error

Failed to create WebGL vertex array

Error message

Failed to create WebGL vertex array

What it means

Thrown by setupVignette when gl.createVertexArray() returns null. Vignette needs a VAO to bind the fullscreen-quad vertex attributes; without it the pass cannot run. A null return indicates WebGL context loss or the GL implementation's VAO object limit.

Source

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

	return texture;
};

const setupVignette = (target: HTMLCanvasElement): VignetteState => {
	const gl = target.getContext('webgl2', {
		premultipliedAlpha: true,
		alpha: true,
		preserveDrawingBuffer: true,
	});
	if (!gl) {
		throw createWebGL2ContextError('vignette effect');
	}

	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);

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Reload to reset the WebGL2 context.
  2. Cut concurrent WebGL effect count.
  3. Confirm hardware-accelerated WebGL2 and update drivers.
  4. Dispose effects on offscreen sequences.

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 VAO alloc failed, skipping effect', err);
}

Prevention

When it happens

Trigger: setupVignette calls gl.createVertexArray() after createProgram; it returns null because the context is lost or the VAO budget is exhausted.

Common situations: Context loss with many concurrent effects; driver VAO caps; headless Chrome resource limits.

Related errors


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