remotion-dev/remotion · error · Error

Levels shader compile failed: ${log ?? '(no log)'}

Error message

Levels shader compile failed: ${log ?? '(no log)'}

What it means

Thrown by `compileShader()` in the levels effect when `gl.getShaderParameter(shader, gl.COMPILE_STATUS)` is false. The bundled GLSL (VERTEX_SHADER / FRAGMENT_SHADER) failed to compile, and the driver's info log is appended. Because the shaders are static and shipped with the package, a compile failure almost always points to a driver/GPU bug or a non-conformant WebGL2 implementation rather than user input.

Source

Thrown at packages/effects/src/levels.ts:169

}
`;

const compileShader = (
	gl: WebGL2RenderingContext,
	type: number,
	source: string,
): WebGLShader => {
	const shader = gl.createShader(type);
	if (!shader) {
		throw new Error('Failed to create levels shader');
	}

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

	return shader;
};

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 levels shader program');
	}

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

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Update the GPU driver / Chromium / Remotion to the latest version — shader regressions are frequently fixed upstream.
  2. Switch the headless renderer to a GPU-backed Chrome or a newer swiftshader that supports GLSL ES 3.00.
  3. Capture the `log` string in the error message and report it with the GPU/driver version to the Remotion issue tracker.
  4. As a stopgap, disable the `levels()` effect on the affected composition and re-render.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  levels({...})(...);
} catch (err) {
  if (/Levels shader compile failed/.test(String(err))) {
    // driver/shader bug: log the GLSL info log and skip the effect
    console.error('levels() shader compile failure:', String(err));
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: A GPU driver with incomplete GLSL ES 3.00 support; swiftshader/llvmpipe software rasterizers rejecting an instruction; a Chromium regression; running under a virtual display without proper WebGL2 backing.

Common situations: CI runners on software rasterizers; older mobile GPU drivers; a browser/Chromium downgrade that introduced a GLSL compiler regression; containers without a GPU device.

Related errors


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