remotion-dev/remotion · error · Error
Failed to create WebGL buffer
Error message
Failed to create WebGL buffer
What it means
Thrown in setupCornerPin when gl.createBuffer() returns null. The WebGL2 context was acquired but could not allocate a buffer object for the fullscreen-quad vertex data. This is a GPU resource exhaustion or context-loss issue, not a user parameter problem.
Source
Thrown at packages/effects/src/corner-pin/corner-pin-runtime.ts:120
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
const program = createProgram(gl, CORNER_PIN_VS, CORNER_PIN_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);
gl.enableVertexAttribArray(0);
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 16, 0);
gl.enableVertexAttribArray(1);
gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 16, 8);
gl.bindVertexArray(null);
const textureSource = createRgbaTexture(gl);
return {
gl,
program,
vao,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Reduce the number of simultaneously active WebGL effects.
- Check gl.isContextLost() before and during setup.
- Use a rendering environment with adequate GPU resources.
- Implement webglcontextlost handling to reinitialize.
Defensive patterns
Strategy: try-catch
Validate before calling
// Verify WebGL2 context health before corner pin setup
const gl = target.getContext('webgl2');
if (gl?.isContextLost()) {
// defer or skip
} Try / catch
try {
cornerPin({...})(source, target);
} catch (e) {
if (e instanceof Error && e.message === 'Failed to create WebGL buffer') {
// GPU resource issue — reduce concurrent effects
}
throw e;
} Prevention
- Reduce the number of simultaneously active WebGL effects.
- Check gl.isContextLost() during setup.
- Use a rendering environment with adequate GPU resources.
- Handle webglcontextlost to reinitialize.
When it happens
Trigger: During corner-pin effect initialization, after VAO creation, gl.createBuffer() returns null when allocating the vertex buffer.
Common situations: GPU resource exhaustion from many simultaneous effects; context lost between VAO and buffer creation; constrained software WebGL in headless/CI/VM environments.
Related errors
- Failed to create WebGL buffer
- Failed to create WebGL shader
- Failed to create WebGL program
- Failed to create WebGL texture
- Failed to create WebGL vertex array
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/b1c10bd7114bf1fc.
Report an issue: GitHub.