{"record":{"id":"f4ee9b35f69879b5","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-f4ee9b","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/noise-displacement.ts","lineNumber":467,"sourceCode":"\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('noise displacement effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst vs = compileShader(gl, gl.VERTEX_SHADER, NOISE_DISPLACEMENT_VS);\n\tconst fs = compileShader(gl, gl.FRAGMENT_SHADER, NOISE_DISPLACEMENT_FS);\n\tconst program = linkProgram(gl, vs, fs);\n\tgl.deleteShader(vs);\n\tgl.deleteShader(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":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/noise-displacement.ts#L449-L485","documentation":"While setting up the noiseDisplacement effect's geometry, gl.createVertexArray() returned null. The WebGL2 context created shaders, program, and linked successfully, but cannot allocate a VAO — indicating context degradation, resource limits, or driver issues late in the setup sequence.","triggerScenarios":"During setupNoiseDisplacement, after the program is linked and shaders deleted, gl.createVertexArray() returns null. The VAO is needed to encapsulate the aPos and aUv attribute bindings.","commonSituations":"Context loss during setup; GPU driver hitting VAO allocation limits; headless environments with incomplete WebGL2 VAO support; resource exhaustion from many concurrent effects.","solutions":["Ensure the environment fully supports WebGL2 VAOs — update GPU drivers.","Handle WebGL context loss and retry rendering.","Reduce concurrent WebGL effects.","For headless/CI rendering, verify Chrome GPU flags enable WebGL2 VAO operations."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // apply noiseDisplacement effect\n} catch (e) {\n  if (e instanceof Error && e.message.includes('WebGL vertex array')) {\n    console.warn('WebGL VAO creation failed, skipping noiseDisplacement effect');\n    // fallback path\n  } else {\n    throw e;\n  }\n}","preventionTips":["Ensure WebGL2 VAO support in the render environment — update GPU drivers.","Handle context loss and retry rendering.","Limit concurrent WebGL effects to avoid VAO allocation limits."],"tags":["webgl","gpu","environment","noise-displacement","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}