remotion-dev/remotion · error · Error

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

Error message

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

What it means

The shrinkwrap() effect links its compiled vertex and fragment shaders via gl.linkProgram(). If linking fails (LINK_STATUS is false), the effect reads the info log, deletes the program, and throws this Error with the diagnostic. The shrinkwrap fragment shader is unusually complex (fBm noise with 4x loops, multiple curved-fold field evaluations, specular lighting), so link-time resource allocation can exceed driver limits even when both shaders compile individually.

Source

Thrown at packages/effects/src/shrinkwrap.ts:433

};

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);
	if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
		const log = gl.getProgramInfoLog(program);
		gl.deleteProgram(program);
		throw new Error(`Shrinkwrap program link failed: ${log ?? '(no log)'}`);
	}

	return program;
};

export const shrinkwrap = createEffect<ShrinkwrapParams, ShrinkwrapState>({
	type: 'dev.remotion.effects.shrinkwrap',
	label: 'shrinkwrap()',
	documentationLink: 'https://www.remotion.dev/docs/effects/shrinkwrap',
	backend: 'webgl2',
	calculateKey: (params) => {
		const r = resolve(params);
		return `shrinkwrap-${r.amount}-${r.displacement}-${r.highlightIntensity}-${r.wrinkleDensity}-${r.edgeTension}-${r.phase}-${r.seed}`;
	},
	setup: (target) => {
		const gl = target.getContext('webgl2', {
			premultipliedAlpha: true,
			alpha: true,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Read the info log in the error message for the specific link diagnostic.
  2. Update GPU drivers and the Chromium version to the latest release.
  3. Switch to a render environment with a more capable WebGL2 stack.
  4. File a Remotion issue including the GPU vendor, driver version, and full info log — the shader complexity may need a portability fix.

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try {
  shrinkwrap({ amount: 1 });
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Shrinkwrap program link failed')) {
    console.error('Shrinkwrap program link error:', e.message);
    // Very complex shader — may exceed driver link-time limits
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Calling shrinkwrap() on a GPU/driver that compiles both shaders but fails to link due to exceeded uniform/varying limits, instruction count after link-time optimization, or total register pressure. The complex shader increases the chance of hitting these limits vs. simpler effects.

Common situations: Older or low-end GPUs with conservative uniform/temporary register limits; software rasterizers (SwiftShader) with strict link-time resource caps; driver bugs in link-time allocation for complex fragment shaders; specific GPU families with known ANGLE translation issues.

Related errors


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