remotion-dev/remotion · critical · Error
Failed to create region blur WebGL resources
Error message
Failed to create region blur WebGL resources
What it means
The region-blur runtime creates a VAO, VBO, and framebuffer in sequence and checks all three at once. If any of gl.createVertexArray(), gl.createBuffer(), or gl.createFramebuffer() returns null, the effect throws this consolidated error because it cannot determine which specific allocation failed. This indicates context loss or severe resource exhaustion.
Source
Thrown at packages/effects/src/region-blur/region-blur-runtime.ts:175
});
if (!gl) {
throw createWebGL2ContextError('region blur effect');
}
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
const horizontalProgram = createProgram(gl, BLUR_VS, BLUR_FS_HORIZONTAL);
const verticalProgram = createProgram(gl, BLUR_VS, BLUR_FS_VERTICAL);
const compositeProgram = createProgram(
gl,
BLUR_VS,
COMPOSITE_FRAGMENT_SHADER,
);
const vao = gl.createVertexArray();
const vbo = gl.createBuffer();
const framebuffer = gl.createFramebuffer();
if (!vao || !vbo || !framebuffer) {
throw new Error('Failed to create region blur WebGL resources');
}
gl.bindVertexArray(vao);
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
gl.bufferData(
gl.ARRAY_BUFFER,
new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),
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);
return {
gl,
horizontalProgram,View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Handle 'webglcontextlost'/'webglcontextrestored' and reinitialize after restoration
- Dispose of all unused effects to free VAOs, VBOs, and FBOs
- Reduce the number of concurrent GPU effects
- Restart the render in a fresh Headless Chrome instance if GL state is corrupted
Defensive patterns
Strategy: retry
Try / catch
canvas.addEventListener('webglcontextlost', (e) => { e.preventDefault(); }, false);
canvas.addEventListener('webglcontextrestored', () => {
// re-initialize region-blur effect, re-creating VAO/VBO/FBO
}, false); Prevention
- Handle context loss/restoration events
- Dispose of region-blur effects to free GL objects
- Limit concurrent WebGL2 effects
When it happens
Trigger: Calling setupRegionBlur() on a lost/exhausted context where at least one of VAO, VBO, or FBO allocation fails. The combined check (|| !vao || !vbo || !framebuffer) means the first null short-circuits the rest.
Common situations: Context loss after GPU crash; long-running sessions leaking GL objects; mobile GPUs with very low object limits; many concurrent WebGL2 effects depleting the shared pool.
Related errors
- Failed to create WebGL shader
- Failed to create WebGL program
- Failed to create WebGL texture
- Failed to create WebGL program
- Failed to create WebGL texture
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/d598403420fbfcde.
Report an issue: GitHub.