{"record":{"id":"0d1c7e0402891a6a","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-0d1c7e","errorCode":null,"errorMessage":"Failed to create WebGL vertex array","messagePattern":"Failed to create WebGL vertex array","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/contour-lines.ts","lineNumber":435,"sourceCode":"};\n\nconst setupContourLines = (target: HTMLCanvasElement): ContourLinesState => {\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('contour lines effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, CONTOUR_LINES_VS, CONTOUR_LINES_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');","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/contour-lines.ts#L417-L453","documentation":"Thrown in setupContourLines when gl.createVertexArray() returns null. The WebGL2 context was acquired but could not allocate a VAO (vertex array object). This is a GPU resource exhaustion or context-loss issue.","triggerScenarios":"During contour-lines effect initialization, after the shader program is created, gl.createVertexArray() returns null.","commonSituations":"Too many VAOs allocated across effects; context lost; GPU memory pressure; constrained software WebGL implementation.","solutions":["Reduce concurrent WebGL effects to lower VAO allocation pressure.","Verify the context is not lost via gl.isContextLost().","Use a GPU-capable rendering environment.","Handle webglcontextlost for recovery."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify WebGL2 context health before effect setup\nconst gl = target.getContext('webgl2');\nif (gl?.isContextLost()) {\n  // defer or skip\n}","typeGuard":null,"tryCatchPattern":"try {\n  contourLines({...})(source, target);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Failed to create WebGL vertex array') {\n    // GPU resource issue — reduce concurrent effects\n  }\n  throw e;\n}","preventionTips":["Reduce concurrent WebGL effects to lower VAO allocation pressure.","Check gl.isContextLost() before effect setup.","Use a GPU-capable rendering environment.","Handle webglcontextlost events."],"tags":["webgl","effects","contour-lines","gpu","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}