remotion-dev/remotion · error · Error

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

Error message

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

What it means

Thrown by createProgram() in exposure.ts when gl.getProgramParameter(program, gl.LINK_STATUS) is false after gl.linkProgram() (exposure.ts:143-147). Both shaders compiled, but the linker rejected the program (e.g. incompatible varying declarations, missing uniforms, or a driver linker bug). The InfoLog is included and the half-linked program is deleted.

Source

Thrown at packages/effects/src/exposure.ts:146

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 exposure 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(`Exposure 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 exposure 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. Render with --gl=angle (CLI) / chromiumOptions.gl='angle' (SSR) / Angle (Studio) to use a stable linker.
  2. Read the InfoLog in the error message; if it names a varying/uniform mismatch, verify exposure.ts was not locally edited and that the aPos/aUv attributes match between stages.
  3. Update GPU drivers or switch to a known-good software GL path.
  4. Confirm the context is healthy (gl.isContextLost()) and restore before retrying.
  5. Report the driver linker bug if the GLSL is valid and the InfoLog is nonsensical.

Example fix

// before
gl.linkProgram(program);
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
  // linker rejected exposure program
}

// after (force a stable linker)
// CLI:  remotion render <comp> --gl=angle
// SSR:  renderMediaOnLambda({ chromiumOptions: { gl: 'angle' } })
Defensive patterns

Strategy: try-catch

Validate before calling

// No user input affects linking; both shader stages are fixed strings.
// Pre-check only context health before setup.
const isContextHealthy = (gl: WebGL2RenderingContext): boolean =>
  !gl.isContextLost();

Try / catch

try {
  // apply exposure(); for a custom canvas: const state = setupExposure(canvas);
} catch (err) {
  if (err instanceof Error && /Exposure shader link failed/.test(err.message)) {
    // err.message has the InfoLog; render on Angle and retry.
    console.error('exposure link failure:', err.message);
    throw err;
  }
  throw err;
}

Prevention

When it happens

Trigger: setupExposure() links VERTEX_SHADER + FRAGMENT_SHADER and LINK_STATUS comes back false. Because both stages are fixed GLSL strings whose varying/uniform contract is fixed (vUv, uSource, uStops), a link failure points at a driver/translator linker bug or a degraded context — not user input.

Common situations: Software GL / SwiftShader translators with buggy linkers in headless CI; outdated GPU drivers; a context that is partly broken after a GPU process reset; local edits that desync VERTEX_SHADER and FRAGMENT_SHADER varying declarations.

Related errors


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