remotion-dev/remotion · critical · Error

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

Error message

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

What it means

Thrown when the GLSL source for lightTrail fails `gl.compileShader`. The message includes the driver's info log. With a frozen, tested shader this almost always indicates a driver/compiler bug or a context that lost GPU memory mid-compile, not a user error.

Source

Thrown at packages/effects/src/light-trail/light-trail-runtime.ts:44

	cachedColorRgba: ParsedColorRgba;
};

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(`Light trail 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

  1. Read the embedded `${log}` — it names the offending GLSL line/extension and is the primary diagnostic.
  2. Update the GPU driver / try a different Chromium build (especially on Lambda, pin the Chrome layer).
  3. If the log points at a precision/extension issue, report it as a @remotion/effects bug rather than working around it locally.
  4. On context loss, dispose and re-setup after `webglcontextrestored`.
  5. As a stopgap, disable the lightTrail effect for the affected environment.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  setupLightTrail(canvas);
} catch (err) {
  const log = String(err?.message ?? '');
  reportToTelemetry({ kind: 'shader-compile', log, ua: navigator.userAgent });
  renderWithoutEffect();
}

Prevention

When it happens

Trigger: The bundled vertex/fragment shader source failing on a non-conformant driver; a context-loss or OOM during compilation causing the compiler to emit a spurious error; running on a stripped WebGL2 implementation that rejects a used extension or precision qualifier.

Common situations: Older Android/Chromium WebGL2 stacks; virtualized/remote GPU (RDP, old VMWare); a driver update that introduced a regression; very rare in evergreen desktop Chrome.

Related errors


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