{"record":{"id":"ef995680f5fa67da","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-buffer-ef9956","errorCode":null,"errorMessage":"Failed to create WebGL buffer","messagePattern":"Failed to create WebGL buffer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/vignette.ts","lineNumber":359,"sourceCode":"\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, VIGNETTE_VS, VIGNETTE_FS);\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 textureSource = createRgbaTexture(gl);\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) {","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/vignette.ts#L341-L377","documentation":"Thrown by setupVignette when gl.createBuffer() returns null. The vertex buffer carries the fullscreen-quad geometry used by the vignette shader; without it the pass cannot run. A null return means context loss or GL object/memory exhaustion.","triggerScenarios":"setupVignette calls gl.createBuffer() after binding the VAO; it returns null because the context is lost or the buffer-object budget is hit.","commonSituations":"Context loss under heavy effect load; GPU memory pressure; headless Chrome limits.","solutions":["Reload to reset the context and release buffers.","Reduce concurrent WebGL effects.","Verify hardware-accelerated WebGL2 and update drivers.","Dispose offscreen effects to free GL objects."],"exampleFix":"// before\nconst effect = vignette({amount: 0.6});\n\n// after\nconst effect = (() => {\n  try { return vignette({amount: 0.6}); } catch { return null; }\n})();","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let effect = null;\ntry {\n  effect = vignette({amount: 0.6});\n} catch (err) {\n  console.warn('vignette VBO alloc failed, skipping effect', err);\n}","preventionTips":["Dispose offscreen effects to release GL buffers.","Handle 'webglcontextlost'/'webglcontextrestored' and rebuild effects.","Limit concurrent WebGL effects to avoid buffer-object exhaustion.","Render on hardware with adequate GL resources."],"tags":["webgl2","gpu-memory","context-loss","vignette"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}