remotion-dev/remotion · error · Error

Failed to create WebGL program

Error message

Failed to create WebGL program

What it means

Thrown by the venetian-blinds effect's linkProgram helper when gl.createProgram() returns null after both shaders compiled successfully. This indicates the GL context lost validity between shader compilation and program creation, or the driver refused another program object.

Source

Thrown at packages/effects/src/venetian-blinds.ts:214

	if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
		const log = gl.getShaderInfoLog(shader);
		gl.deleteShader(shader);
		throw new Error(
			`Venetian blinds shader compile failed: ${log ?? '(no log)'}`,
		);
	}

	return shader;
};

const linkProgram = (
	gl: WebGL2RenderingContext,
	vs: WebGLShader,
	fs: WebGLShader,
): WebGLProgram => {
	const program = gl.createProgram();
	if (!program) {
		throw new Error('Failed to create WebGL program');
	}

	gl.attachShader(program, vs);
	gl.attachShader(program, fs);
	gl.linkProgram(program);
	if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
		const log = gl.getProgramInfoLog(program);
		gl.deleteProgram(program);
		throw new Error(
			`Venetian blinds program link failed: ${log ?? '(no log)'}`,
		);
	}

	return program;
};

const setupVenetianBlinds = (
	target: HTMLCanvasElement,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Reduce concurrent render parallelism to keep GL object counts within driver limits
  2. Handle webglcontextlost and re-run the render after restoration
  3. Update GPU drivers
  4. If the issue is persistent, test with a different GPU to isolate whether it is a driver bug
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const state = setupVenetianBlinds(canvas);
} catch (err) {
  if (err instanceof Error && err.message === 'Failed to create WebGL program') {
    // Context lost between shader compilation and program creation.
    throw new Error('WebGL2 context lost during venetian-blinds program creation. Retry render.');
  }
  throw err;
}

Prevention

When it happens

Trigger: Both vertex and fragment shaders compiled without error, but gl.createProgram() returns null. Occurs when the context transitions to lost state after compilation, or when the driver has exhausted its program object pool.

Common situations: Context loss mid-setup during a batch render; driver resource limits hit with many effects in a single composition; long-running render where GL state degrades.

Related errors


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