remotion-dev/remotion · error · Error
Linear gradient program link failed: ${log ?? '(no log)'}
Error message
Linear gradient program link failed: ${log ?? '(no log)'} What it means
Thrown by createProgram() in the linear-gradient effect when gl.linkProgram() reports a non-LINK_STATUS. The interpolated log carries the driver's linker message. Because the vertex/fragment shaders are fixed and compiled cleanly, a link failure here indicates the driver failed to reconcile them (varying/uniform mismatch on that implementation) rather than a library-logic error.
Source
Thrown at packages/effects/src/linear-gradient.ts:203
const createProgram = (gl: WebGL2RenderingContext): WebGLProgram => {
const vs = compileShader(gl, gl.VERTEX_SHADER, VERTEX_SHADER);
const fs = compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);
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);
gl.deleteShader(vs);
gl.deleteShader(fs);
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
const log = gl.getProgramInfoLog(program);
gl.deleteProgram(program);
throw new Error(
`Linear gradient program link failed: ${log ?? '(no log)'}`,
);
}
return program;
};
const setupLinearGradient = (
target: HTMLCanvasElement,
): LinearGradientState => {
const gl = target.getContext('webgl2', {
premultipliedAlpha: true,
alpha: true,
preserveDrawingBuffer: true,
});
if (!gl) {
throw createWebGL2ContextError('linear gradient effect');
}View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Inspect the interpolated linker log for the exact mismatch the driver reported.
- Restart Chrome / the render worker to clear stale context state and retry.
- Switch to a software GL backend (`--gl=angle --angle-backend=swiftshader`) that implements linking deterministically.
- Update Chrome and GPU drivers; on serverless, move to a Remotion-published Chrome layer.
- If reproducible on a specific driver, file an issue against @remotion/effects with the driver string and the linker log.
Defensive patterns
Strategy: retry
Try / catch
try {
renderWithLinearGradient();
} catch (err) {
if (err instanceof Error && err.message.startsWith('Linear gradient program link failed')) {
console.error(err.message); // driver linker log
await withGlBackend('swiftshader', () => renderWithLinearGradient());
} else throw err;
} Prevention
- Use SwiftShader/ANGLE on CI and Lambda for deterministic program linking.
- Restart the worker after any Chrome GPU-process crash to discard stale context state.
- Capture the linker log when this fires to identify the driver defect.
- Report reproducible driver-specific link failures to @remotion/effects.
When it happens
Trigger: Both VERTEX_SHADER and FRAGMENT_SHADER compiled, but the driver's linker rejected the combined program — a known class of WebGL2 driver bug where varying declarations (vUv) or precision qualifiers are matched inconsistently. Also seen after a GPU-process crash leaves context state inconsistent.
Common situations: Buggy mobile/integrated GPU drivers, older mesa on headless Linux, Chrome GPU-process crash mid-session, or a remote-rendering host with a stripped GL stack.
Related errors
- Skew program link failed: ${log ?? '(no log)'}
- Speckle program link failed: ${log ?? '(no log)'}
- Evolve program link failed: ${log ?? '(no log)'}
- Exposure shader link failed: ${log ?? '(no log)'}
- Program link failed: ${log ?? '(no log)'}
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/4290336717f5c861.
Report an issue: GitHub.