remotion-dev/remotion · error · Error
Failed to create WebGL buffer
Error message
Failed to create WebGL buffer
What it means
Thrown inside `lightLeak`'s setup when `gl.createBuffer()` returns `null`. The vertex buffer holding the fullscreen-quad data could not be allocated — context loss or GPU buffer memory/object-slot exhaustion.
Source
Thrown at packages/effects/src/light-leak.ts:267
const fs = compileShader(gl, gl.FRAGMENT_SHADER, LIGHT_LEAK_FS);
const program = linkProgram(gl, vs, fs);
gl.deleteShader(vs);
gl.deleteShader(fs);
const vao = gl.createVertexArray();
if (!vao) {
throw new Error('Failed to create WebGL vertex array');
}
gl.bindVertexArray(vao);
const data = new Float32Array([
-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,
]);
const vbo = gl.createBuffer();
if (!vbo) {
throw new Error('Failed to create WebGL buffer');
}
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
const aPos = gl.getAttribLocation(program, 'aPos');
const aUv = gl.getAttribLocation(program, 'aUv');
gl.enableVertexAttribArray(aPos);
gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);
gl.enableVertexAttribArray(aUv);
gl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);
gl.bindVertexArray(null);
const texture = gl.createTexture();
if (!texture) {
throw new Error('Failed to create WebGL texture');
}View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Reduce concurrency and dispose unused GL buffers.
- Handle context loss and recreate the effect.
- Restart the GPU/Chrome process to reclaim leaked buffer objects.
- Render with adequate video memory.
Defensive patterns
Strategy: try-catch
Try / catch
try {
lightLeak({...})(...);
} catch (err) {
if (/Failed to create WebGL buffer/.test(String(err))) {
console.warn('lightLeak() VBO unavailable', err);
} else {
throw err;
}
} Prevention
- Dispose GL buffers between renders to prevent leaks.
- Lower concurrency on constrained renderers.
- Handle context-loss events before retrying.
When it happens
Trigger: Context lost before buffer creation; many concurrent buffer allocations; VRAM exhaustion.
Common situations: Long-running or concurrent renders leaking GL buffers; constrained CI/Lambda; suspended tabs.
Related errors
- Failed to create levels vertex buffer
- Failed to create WebGL shader
- Failed to create WebGL program
- Failed to create WebGL vertex array
- Failed to create WebGL texture
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/2c3925813f4a4261.
Report an issue: GitHub.