{"record":{"id":"af03c3f241ea6e90","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-af03c3","errorCode":null,"errorMessage":"Failed to create WebGL vertex array","messagePattern":"Failed to create WebGL vertex array","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/blur/blur-runtime.ts","lineNumber":128,"sourceCode":"\nexport const setupBlur = (target: HTMLCanvasElement): BlurState => {\n\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('blur effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst programHorizontal = createProgram(gl, BLUR_VS, BLUR_FS_HORIZONTAL);\n\tconst programVertical = createProgram(gl, BLUR_VS, BLUR_FS_VERTICAL);\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);","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/blur/blur-runtime.ts#L110-L146","documentation":"Thrown by `setupBlur` when `gl.createVertexArray()` returns `null`. The VAO holds the shared fullscreen-quad bindings used by both blur passes. A null result is a resource/context-loss condition, not a usage error.","triggerScenarios":"Fires at line 126-128, after both blur programs are created, when `gl.createVertexArray()` yields null.","commonSituations":"Context loss during blur setup; VAO cap reached by many concurrent effects; software renderer with low object limits.","solutions":["Guard with `gl.isContextLost()`; reinitialize after `webglcontextrestored`.","Free unused blur states via `cleanupBlur`.","Limit concurrent WebGL effects.","Ensure hardware-accelerated WebGL2."],"exampleFix":"if (gl.isContextLost()) {\n  // reinitialize after restore\n} else {\n  const state = setupBlur(canvas);\n}","handlingStrategy":"try-catch","validationCode":"if (gl.isContextLost()) { /* skip setupBlur */ }","typeGuard":null,"tryCatchPattern":"try {\n  const state = setupBlur(canvas);\n} catch (err) {\n  if (/Failed to create WebGL vertex array/.test(err.message)) {\n    // await restore or reduce effects, then retry\n  } else { throw err; }\n}","preventionTips":["Release VAOs via cleanupBlur on unused states.","Handle context-loss events.","Cap concurrent active effects."],"tags":["webgl2","vao","blur","gpu-memory","context-loss"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}