remotion-dev/remotion · error · Error
Duotone shader compile failed: ${log ?? '(no log)'}
Error message
Duotone shader compile failed: ${log ?? '(no log)'} What it means
Thrown by duotone's compileShader() when gl.getShaderParameter(shader, gl.COMPILE_STATUS) is false. The driver's info log is embedded in the message. Because DUOTONE_VS / DUOTONE_FS are hardcoded #version 300 es GLSL constants inside the library (the caller never supplies shader source), a compile failure is never a user-input problem: it indicates the WebGL2 driver cannot translate or accept the library's GLSL ES 3.00 shader.
Source
Thrown at packages/effects/src/duotone.ts:146
}
`;
const compileShader = (
gl: WebGL2RenderingContext,
type: number,
source: string,
): WebGLShader => {
const shader = gl.createShader(type);
if (!shader) {
throw new Error('Failed to create WebGL 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(`Duotone 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);View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Switch the render GL backend and re-render: `npx remotion render <comp> --gl=swiftshader` (or --gl=angle / --gl=swangle) to bypass the failing driver path.
- Update the system GPU driver and/or the Chromium build Remotion uses.
- If rendering on Lambda, confirm the function uses a supported Chrome layer version.
- If the failure reproduces identically across swiftshader, angle, and swangle, file a Remotion bug with the full shader info log from the message.
Defensive patterns
Strategy: fallback
Try / catch
// You cannot 'fix' a driver rejecting a fixed library shader; fall back to a
// software/ANGLE backend that translates GLSL differently.
async function renderWithFallback(opts) {
try {
return await renderMedia(opts);
} catch (err) {
const msg = String(err?.message ?? '');
if (/shader compile failed/i.test(msg)) {
return await renderMedia({...opts, gl: 'swiftshader'});
}
throw err;
}
} Prevention
- Choose a known-good GL backend for the target platform (swiftshader is the safest headless default).
- Update GPU drivers and the Chromium build before debugging shader failures.
- On Lambda, use a current Chrome layer so the bundled shader translator is up to date.
- Keep the embedded info log when reporting; it identifies the exact GLSL line the driver rejected.
When it happens
Trigger: Rendering or previewing duotone() on a GPU/driver that rejects the bundled vertex or fragment shader. The shader source is fixed; only the driver varies.
Common situations: Outdated or buggy GPU drivers, an ANGLE/SwiftShader regression, a virtualized or headless environment with incomplete WebGL2 shader translation, or a Chromium update that changed how the shader is compiled.
Related errors
- Failed to create WebGL shader
- Checkerboard shader compile failed: ${log ?? '(no log)'}
- Failed to create WebGL shader
- Shader compile failed: ${log ?? '(no log)'}
- Duotone program link failed: ${log ?? '(no log)'}
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/8e9497c0e06ef835.
Report an issue: GitHub.