remotion-dev/remotion · critical · Error

Failed to create WebGL vertex array

Error message

Failed to create WebGL vertex array

What it means

During starburst effect `setup`, `gl.createVertexArray()` returned `null`. A vertex array object (VAO) could not be allocated, indicating context loss or GL resource exhaustion. The error fires after the program is linked and shaders are deleted, before geometry is uploaded.

Source

Thrown at packages/effects/src/starburst.ts:303

			premultipliedAlpha: true,
			alpha: true,
			preserveDrawingBuffer: true,
		});
		if (!gl) {
			throw createWebGL2ContextError('starburst effect');
		}

		gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);

		const vs = compileShader(gl, gl.VERTEX_SHADER, STARBURST_VS);
		const fs = compileShader(gl, gl.FRAGMENT_SHADER, STARBURST_FS);
		const program = linkProgram(gl, vs, fs);
		gl.deleteShader(vs);
		gl.deleteShader(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. Lower the number of concurrent webgl2 effects.
  2. Restart the render/Studio to reset GL state.
  3. Verify headless browser WebGL2 support.
  4. Handle `webglcontextlost` to recreate contexts before re-running setup.
Defensive patterns

Strategy: fallback

Try / catch

try {
  starburst({...params});
} catch (e) {
  if (/Failed to create WebGL vertex array/.test((e as Error).message)) {
    renderFallbackFrame();
  } else throw e;
}

Prevention

When it happens

Trigger: Context lost between program linking and VAO creation; driver out of VAO resources; WebGL2 context in a destroyed state.

Common situations: High concurrent webgl2 effect count; long sessions after a driver reset; restrictive headless WebGL2 backends.

Related errors


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