{"record":{"id":"2260fed8795b3d97","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-buffer-2260fe","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/checkerboard.ts","lineNumber":373,"sourceCode":"\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, CHECKERBOARD_VS, CHECKERBOARD_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":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/checkerboard.ts#L355-L391","documentation":"Thrown by setupCheckerboard() when gl.createBuffer() returns null while allocating the fullscreen-quad vertex buffer. The buffer carries the position/UV data the checkerboard shader draws; without it the VAO cannot feed attributes, so setup aborts. Null indicates a lost context or exhausted GL buffer budget.","triggerScenarios":"setupCheckerboard() calls gl.createBuffer() at checkerboard.ts:371 inside the bound VAO; it returns null and the guard at :372 throws.","commonSituations":"Many concurrent compositions exhausting GL object budgets, software raster overload, --disable-gpu, GPU blacklisted, or a context-loss event after VAO creation.","solutions":["Reduce simultaneous checkerboard/WebGL effects.","Enable GPU acceleration; remove --disable-gpu.","Handle 'webglcontextlost'/'webglcontextrestored' and rebuild the effect.","Update GPU drivers and confirm WebGL2 buffer support.","Use a GPU/higher-memory tier for server-side rendering."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"function probeWebGL2(): boolean {\n  try {\n    const c = document.createElement('canvas');\n    const gl = c.getContext('webgl2');\n    if (!gl) return false;\n  const b = gl.createBuffer();\n  const ok = !!b;\n  if (b) gl.deleteBuffer(b);\n  return ok && !gl.isContextLost();\n  } catch {\n  return false;\n  }\n}\nif (!probeWebGL2()) skipOrFallback();","typeGuard":null,"tryCatchPattern":"try {\n  return <Checkerboard {...props} />;\n} catch (err) {\n  if (/Failed to create WebGL buffer/.test(String(err))) return <FallbackFrame />;\n  throw err;\n}","preventionTips":["Reduce concurrent checkerboard/WebGL effects to stay within buffer budgets.","Enable GPU acceleration; remove --disable-gpu.","Handle context loss/restore and rebuild the effect.","Confirm WebGL2 buffer support via updated drivers."],"tags":["webgl","gpu","buffer","effects","checkerboard","rendering"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}