remotion-dev/remotion · critical · Error
Failed to create WebGL program
Error message
Failed to create WebGL program
What it means
While linking the noiseDisplacement effect's compiled shaders into a WebGL program, gl.createProgram() returned null. The WebGL2 context compiled shaders successfully but cannot allocate a program object, indicating context degradation or severe resource exhaustion.
Source
Thrown at packages/effects/src/noise-displacement.ts:428
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
const log = gl.getShaderInfoLog(shader);
gl.deleteShader(shader);
throw new Error(
`Noise displacement 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);
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
const log = gl.getProgramInfoLog(program);
gl.deleteProgram(program);
throw new Error(
`Noise displacement program link failed: ${log ?? '(no log)'}`,
);
}
return program;
};
const setupNoiseDisplacement = (
target: HTMLCanvasElement,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Reduce concurrent WebGL effects to lower program allocation pressure.
- Handle WebGL context loss and retry after restoration.
- Update GPU drivers or use a more capable GPU.
- Verify headless Chrome GPU configuration supports WebGL2 program creation.
Defensive patterns
Strategy: try-catch
Try / catch
try {
// apply noiseDisplacement effect
} catch (e) {
if (e instanceof Error && e.message.includes('WebGL program')) {
console.warn('WebGL program creation failed, falling back without noiseDisplacement');
// fallback rendering path
} else {
throw e;
}
} Prevention
- Reduce the number of concurrent WebGL effects to avoid program allocation limits.
- Handle WebGL context loss and retry rendering.
- Ensure adequate GPU resources in the render environment.
When it happens
Trigger: During setupNoiseDisplacement, linkProgram calls gl.createProgram() which returns null. This happens after both shaders compiled successfully, indicating the context is alive but cannot create program objects.
Common situations: Context loss during setup; GPU memory exhaustion from many concurrent programs; driver bugs under load; headless environments with marginal WebGL2 support.
Related errors
- Failed to create WebGL vertex array
- Failed to create WebGL program
- Failed to create WebGL texture
- Failed to create WebGL vertex array
- Failed to create WebGL buffer
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/895d9e4f6c9cb24a.
Report an issue: GitHub.