{"record":{"id":"d598403420fbfcde","repo":"remotion-dev/remotion","slug":"failed-to-create-region-blur-webgl-resources","errorCode":null,"errorMessage":"Failed to create region blur WebGL resources","messagePattern":"Failed to create region blur WebGL resources","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/region-blur/region-blur-runtime.ts","lineNumber":175,"sourceCode":"\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('region blur effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst horizontalProgram = createProgram(gl, BLUR_VS, BLUR_FS_HORIZONTAL);\n\tconst verticalProgram = createProgram(gl, BLUR_VS, BLUR_FS_VERTICAL);\n\tconst compositeProgram = createProgram(\n\t\tgl,\n\t\tBLUR_VS,\n\t\tCOMPOSITE_FRAGMENT_SHADER,\n\t);\n\tconst vao = gl.createVertexArray();\n\tconst vbo = gl.createBuffer();\n\tconst framebuffer = gl.createFramebuffer();\n\tif (!vao || !vbo || !framebuffer) {\n\t\tthrow new Error('Failed to create region blur WebGL resources');\n\t}\n\n\tgl.bindVertexArray(vao);\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(\n\t\tgl.ARRAY_BUFFER,\n\t\tnew Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),\n\t\tgl.STATIC_DRAW,\n\t);\n\tgl.enableVertexAttribArray(0);\n\tgl.vertexAttribPointer(0, 2, gl.FLOAT, false, 16, 0);\n\tgl.enableVertexAttribArray(1);\n\tgl.vertexAttribPointer(1, 2, gl.FLOAT, false, 16, 8);\n\tgl.bindVertexArray(null);\n\n\treturn {\n\t\tgl,\n\t\thorizontalProgram,","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/region-blur/region-blur-runtime.ts#L157-L193","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"canvas.addEventListener('webglcontextlost', (e) => { e.preventDefault(); }, false);\ncanvas.addEventListener('webglcontextrestored', () => {\n  // re-initialize region-blur effect, re-creating VAO/VBO/FBO\n}, false);","preventionTips":["Handle context loss/restoration events","Dispose of region-blur effects to free GL objects","Limit concurrent WebGL2 effects"],"tags":["webgl","gpu","resource-exhaustion","context-lost","region-blur"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}