remotion-dev/remotion · critical · Error

Flannel program link failed: ${log ?? '(no log)'}

Error message

Flannel program link failed: ${log ?? '(no log)'}

What it means

Thrown when gl.linkProgram fails for the flannel program, with the GPU's info log appended. Link failure means the compiled shaders are individually valid but incompatible (e.g. varying/in-out mismatch, missing uniforms), pointing at a bug in the shipped shader pair.

Source

Thrown at packages/effects/src/flannel.ts:234

	}

	gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
	const vertexShader = compileShader(gl, gl.VERTEX_SHADER, FLANNEL_VS);
	const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, FLANNEL_FS);
	const program = gl.createProgram();
	if (!program) {
		throw new Error('Failed to create WebGL 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(`Flannel program link failed: ${log ?? '(no log)'}`);
	}

	const vao = gl.createVertexArray();
	const vbo = gl.createBuffer();
	if (!vao || !vbo) {
		throw new Error('Failed to create WebGL geometry');
	}

	gl.bindVertexArray(vao);
	gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
	gl.bufferData(
		gl.ARRAY_BUFFER,
		new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),
		gl.STATIC_DRAW,
	);
	const aPos = gl.getAttribLocation(program, 'aPos');
	const aUv = gl.getAttribLocation(program, 'aUv');
	gl.enableVertexAttribArray(aPos);

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Inspect the appended info log for the mismatched symbol.
  2. Restore the shipped shader sources from a clean checkout if modified.
  3. File a Remotion bug with the log and GPU details if it reproduces on the released version.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  effect = flannel(params);
} catch (err) {
  if (/program link failed/i.test(String(err))) {
    console.error('Flannel link failure; info log:', String(err));
  }
  throw err;
}

Prevention

When it happens

Trigger: Vertex and fragment shaders declare mismatched in/out varyings; a uniform referenced in one stage is declared incorrectly in the other; tampered shader source.

Common situations: Editing FLANNEL_VS or FLANNEL_FS and forgetting to mirror an in/out declaration; environment where a GLSL qualifier is rejected at link time.

Related errors


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