remotion-dev/remotion · error · Error
Failed to create WebGL program
Error message
Failed to create WebGL program
What it means
Thrown by wave-runtime's linkProgram when gl.createProgram() returns null. A null program object means WebGL refused the allocation on context loss or object-limit exhaustion. Wave links its compiled shaders into this program, so it cannot continue without one.
Source
Thrown at packages/effects/src/wave/wave-runtime.ts:50
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(`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(`Program link failed: ${log ?? '(no log)'}`);
}
return program;
};
const createProgram = (
gl: WebGL2RenderingContext,
vertexSource: string,
fragmentSource: string,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Reload to reset the WebGL2 context.
- Lower concurrent WebGL effect count.
- Confirm hardware-accelerated WebGL2 and update drivers.
- Free effects on offscreen/unmounted sequences.
Example fix
// before
const effect = wave({amplitude: 60, wavelength: 240});
// after
const effect = (() => {
try { return wave({amplitude: 60, wavelength: 240}); } catch { return null; }
})(); Defensive patterns
Strategy: try-catch
Try / catch
let effect = null;
try {
effect = wave({amplitude: 60, wavelength: 240});
} catch (err) {
console.warn('wave program alloc failed, skipping effect', err);
} Prevention
- Dispose offscreen WebGL effects to free program objects.
- Handle 'webglcontextlost'/'webglcontextrestored' and re-create effects.
- Limit concurrent effects to avoid program-object caps.
- Render on hardware with adequate GL resources.
When it happens
Trigger: wave setup calls createProgram -> linkProgram after both shaders compile; gl.createProgram() returns null because the context is lost or the program-object budget is reached.
Common situations: Context loss with many concurrent effects; driver/GPU object caps; headless Chrome under memory pressure.
Related errors
- Failed to create WebGL shader
- Failed to create WebGL vertex array
- Failed to create WebGL buffer
- Failed to create WebGL shader
- Failed to create WebGL program
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/80a418c6a0e9ae0e.
Report an issue: GitHub.