remotion-dev/remotion · error · Error

Failed to create WebGL vertex array

Error message

Failed to create WebGL vertex array

What it means

Internal error from the `rings()` effect setup: `gl.createVertexArray()` returned `null`. The VAO encapsulates the quad's vertex/uv attribute bindings. A `null` return means the driver could not allocate a VAO object — an environment-level failure (context loss, resource exhaustion, or a driver without robust VAO support) rather than a param error.

Source

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

};

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

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

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Refresh the page or restart the render for a fresh context.
  2. Cut down the number of concurrently mounted effects.
  3. Handle `webglcontextlost`/`webglcontextrestored` to rebuild VAOs.
  4. Update GPU drivers or switch to a hardware-accelerated environment.
Defensive patterns

Strategy: try-catch

Validate before calling

const canAllocateVao = (): boolean => {
  try {
    const c = document.createElement('canvas');
    const gl = c.getContext('webgl2');
    if (!gl) return false;
    const vao = gl.createVertexArray();
    if (vao) gl.deleteVertexArray(vao);
    return !!vao;
  } catch {
    return false;
  }
};

Try / catch

try {
  rings()({...});
} catch (err) {
  if (err instanceof Error && /Failed to create WebGL vertex array/.test(err.message)) {
    // surface a 'GPU resource limit reached' message and reduce effects
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: Calling `rings()` on a context that has been lost; exhausting the driver's VAO pool with many concurrent effects; a non-conformant WebGL2 implementation where VAO creation is unreliable.

Common situations: Long Studio sessions; complex multi-effect compositions; rendering on virtual GPUs.

Related errors


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