{"record":{"id":"8e8f76ea6587dad7","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-buffer-8e8f76","errorCode":null,"errorMessage":"Failed to create WebGL buffer","messagePattern":"Failed to create WebGL buffer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/linear-gradient-tint.ts","lineNumber":296,"sourceCode":"\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl);\n\n\tconst vao = gl.createVertexArray();\n\tif (!vao) {\n\t\tthrow new Error('Failed to create WebGL vertex array');\n\t}\n\n\tgl.bindVertexArray(vao);\n\n\tconst data = new Float32Array([\n\t\t-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,\n\t]);\n\n\tconst vbo = gl.createBuffer();\n\tif (!vbo) {\n\t\tthrow new Error('Failed to create WebGL buffer');\n\t}\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n\n\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');\n\tgl.enableVertexAttribArray(aPos);\n\tgl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);\n\tgl.enableVertexAttribArray(aUv);\n\tgl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);\n\n\tgl.bindVertexArray(null);\n\n\tconst textureSource = createRgbaTexture(gl);\n\n\tconst colorCanvas = document.createElement('canvas');\n\tcolorCanvas.width = 1;","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/linear-gradient-tint.ts#L278-L314","documentation":"Thrown when `gl.createBuffer()` returns null while allocating the fullscreen-quad VBO for linearGradientTint. Failure is limited to context loss or buffer-handle exhaustion.","triggerScenarios":"Setup on a lost context; many effects leaking VBOs; constrained embedded GPU buffer limits.","commonSituations":"Long-lived render sessions that leak buffers; Studio hot-reload without teardown; embedded/VM GPUs.","solutions":["Pair setup with cleanup to free VBOs.","Recover on context restore rather than retrying.","Limit stacked WebGL effects per frame.","Restart workers that accumulate handles."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  setupLinearGradientTint(canvas);\n} catch (err) {\n  renderWithoutEffect();\n}","preventionTips":["Pair setup with cleanup to free buffers.","Reuse cached state; do not allocate per frame.","Recover on context restore."],"tags":["webgl","linear-gradient-tint","effects","gpu","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}