{"record":{"id":"84014f014816b929","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-buffer-84014f","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/waves.ts","lineNumber":461,"sourceCode":"\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, WAVES_VS, WAVES_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\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 colorCanvas = document.createElement('canvas');\n\tcolorCanvas.width = 1;\n\tcolorCanvas.height = 1;\n\tconst colorCtx = colorCanvas.getContext('2d', {willReadFrequently: true});","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/waves.ts#L443-L479","documentation":"Thrown by setupWaves() when gl.createBuffer() returns null. The buffer holds the fullscreen-quad vertex data (interleaved position + UV, 16 bytes per vertex). createBuffer returns null on context loss, context destruction, or resource exhaustion.","triggerScenarios":"Called from setupWaves() at packages/effects/src/waves.ts:459 after the VAO is created and bound. Fires when the GL context cannot allocate a buffer object — typically context loss or buffer object pool exhaustion after VAO and program creation already succeeded.","commonSituations":"Context loss during setup; many concurrent effects without cleanup leaking buffer objects; long-running renders; constrained GPU environments.","solutions":["Handle 'webglcontextlost'/'webglcontextrestored' and recreate the effect on a new canvas.","Ensure cleanup of old waves effect states (cleanup deletes the buffer) before creating new instances.","Reduce concurrent effect canvases to lower buffer object pressure.","Recycle render worker processes between heavy jobs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const state = setupWaves(canvas);\n} catch (e) {\n  if ((e as Error).message === 'Failed to create WebGL buffer') {\n    console.warn('Waves buffer allocation failed:', (e as Error).message);\n  }\n}","preventionTips":["Ensure waves effect cleanup runs on discarded instances.","Handle context loss/restoration events.","Recycle render worker processes in long-running sessions."],"tags":["webgl","gpu","buffer","resource-exhaustion","waves-effect"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}