remotion-dev/remotion · critical · Error

White balance shader link failed: ${log ?? '(no log)'}

Error message

White balance shader link failed: ${log ?? '(no log)'}

What it means

Thrown by createProgram() in the white balance effect when gl.getProgramParameter(program, gl.LINK_STATUS) returns false. The vertex and fragment shaders compiled individually but failed to link into an executable program. The error includes the GL driver's info log. The shaders are static library constants, so this is a driver/GPU compatibility issue, not a user param issue.

Source

Thrown at packages/effects/src/white-balance.ts:161

const createProgram = (gl: WebGL2RenderingContext): WebGLProgram => {
	const vertexShader = compileShader(gl, gl.VERTEX_SHADER, VERTEX_SHADER);
	const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);
	const program = gl.createProgram();
	if (!program) {
		throw new Error('Failed to create white balance shader program');
	}

	gl.attachShader(program, vertexShader);
	gl.attachShader(program, fragmentShader);
	gl.linkProgram(program);
	gl.deleteShader(vertexShader);
	gl.deleteShader(fragmentShader);

	if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
		const log = gl.getProgramInfoLog(program);
		gl.deleteProgram(program);
		throw new Error(`White balance shader link failed: ${log ?? '(no log)'}`);
	}

	return program;
};

const createTexture = (gl: WebGL2RenderingContext): WebGLTexture => {
	const texture = gl.createTexture();
	if (!texture) {
		throw new Error('Failed to create white balance texture');
	}

	gl.bindTexture(gl.TEXTURE_2D, texture);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
	gl.bindTexture(gl.TEXTURE_2D, null);
	return texture;

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Update GPU drivers and browser to the latest versions.
  2. Check chrome://gpu for WebGL2 warnings or denylisted features.
  3. For server-side rendering, use the latest @remotion/renderer with its tested bundled Chrome.
  4. Try a different GPU or toggle hardware acceleration to isolate driver vs SwiftShader.
  5. Report with the full info log from the error message and GPU details.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const state = setupWhiteBalance(canvas);
} catch (e) {
  if ((e as Error).message.startsWith('White balance shader link failed')) {
    console.warn('GPU driver failed to link white balance program:', (e as Error).message);
    // fall back to a non-WebGL color correction approach
  }
}

Prevention

When it happens

Trigger: Called from setupWhiteBalance() at packages/effects/src/white-balance.ts:194 via createProgram(gl). Fires when the GL driver cannot link the compiled vertex and fragment shaders — e.g., mismatched in/out declarations from a driver bug, exceeding uniform limits, or a driver-specific linker issue with the white balance shader's color space functions.

Common situations: GPU driver bug rejecting valid linked GLSL ES 3.00 programs; constrained hardware with low uniform limits; software rasterizer with incomplete program linker; outdated browser with a WebGL2 backend regression.

Related errors


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