{"record":{"id":"064c6745f67f4823","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-buffer-064c67","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/light-trail/light-trail-runtime.ts","lineNumber":127,"sourceCode":"\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, LIGHT_TRAIL_VS, LIGHT_TRAIL_FS);\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\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 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');","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/light-trail/light-trail-runtime.ts#L109-L145","documentation":"Thrown when `gl.createBuffer()` returns null while allocating the fullscreen-quad vertex buffer for lightTrail. Buffer object exhaustion or context loss are the only spec-compliant causes.","triggerScenarios":"Many effects each allocating VBOs without cleanup; setup on a lost context; GL buffer-handle exhaustion on a constrained driver.","commonSituations":"Long-lived render sessions that leak buffers; Studio hot-reload loops that re-setup without teardown; constrained embedded GPUs.","solutions":["Pair `setupLightTrail` with `cleanupLightTrail` so VBOs are freed.","Recover on `webglcontextrestored` instead of retrying immediately.","Limit stacked WebGL effects per frame.","Restart workers that accumulate GL handles over time."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  setupLightTrail(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","light-trail","effects","gpu","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}