{"record":{"id":"aecc8f95dcd1c78e","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-framebuffer-aecc8f","errorCode":null,"errorMessage":"Failed to create WebGL framebuffer","messagePattern":"Failed to create WebGL framebuffer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/drop-shadow/drop-shadow-runtime.ts","lineNumber":196,"sourceCode":"\t}\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n\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\n\tgl.bindVertexArray(null);\n\n\tconst textureSource = createRgbaTexture(gl);\n\tconst textureShadowA = createRgbaTexture(gl);\n\tconst textureShadowB = createRgbaTexture(gl);\n\n\tconst framebuffer = gl.createFramebuffer();\n\tif (!framebuffer) {\n\t\tthrow new Error('Failed to create WebGL framebuffer');\n\t}\n\n\tconst colorCanvas = document.createElement('canvas');\n\tcolorCanvas.width = 1;\n\tcolorCanvas.height = 1;\n\tconst colorCtx = colorCanvas.getContext('2d', {willReadFrequently: true});\n\tif (!colorCtx) {\n\t\tthrow new Error('Failed to acquire 2D context for color parsing');\n\t}\n\n\treturn {\n\t\tgl,\n\t\tprogramExtract,\n\t\tprogramHorizontal,\n\t\tprogramVertical,\n\t\tprogramComposite,\n\t\tvao,\n\t\tvbo,","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/drop-shadow/drop-shadow-runtime.ts#L178-L214","documentation":"Thrown by setupDropShadow when gl.createFramebuffer() returns null. A null framebuffer indicates a lost or resource-exhausted WebGL2 context. The drop-shadow runtime uses offscreen framebuffers for the extract and two blur passes, so the allocation must succeed before any rendering.","triggerScenarios":"Lost WebGL2 context, exhausted framebuffer object limit, or GPU memory pressure. Reached inside setupDropShadow() after textures are allocated, when the render-target framebuffer is created.","commonSituations":"Framebuffer leaks from effects whose cleanup was skipped; many simultaneous drop-shadow effects; GPU driver crash; headless rendering under memory pressure; VMs with passthrough GL.","solutions":["Confirm cleanupDropShadow runs (gl.deleteFramebuffer on unmount).","Reduce simultaneous drop-shadow effects or composition resolution.","Reload to free leaked framebuffers; update GPU drivers.","For headless/CI, use SwiftShader with sufficient memory and limit concurrency."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const supportsWebGL2 = () => {\n  try {\n    return !!document.createElement('canvas').getContext('webgl2');\n  } catch {\n    return false;\n  }\n};","typeGuard":null,"tryCatchPattern":"try {\n  state = setupDropShadow(canvas);\n} catch (err) {\n  if (err instanceof Error && /WebGL framebuffer/i.test(err.message)) {\n    console.error('Drop-shadow framebuffer allocation failed:', err.message);\n    // fall back to a CSS box-shadow layer\n  } else {\n    throw err;\n  }\n}","preventionTips":["Confirm cleanupDropShadow runs so the framebuffer is deleted on unmount.","Reduce composition resolution or simultaneous drop-shadow effects on low-memory GPUs.","Reload to reclaim leaked framebuffers; use SwiftShader with adequate memory for headless runs."],"tags":["webgl2","drop-shadow","framebuffer","gpu","runtime","memory"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}