{"record":{"id":"a802a688f830d257","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-a802a6","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/thermal-vision.ts","lineNumber":241,"sourceCode":"};\n\nconst setupThermalVision = (target: HTMLCanvasElement): ThermalVisionState => {\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('thermal vision effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, THERMAL_VISION_VS, THERMAL_VISION_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":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/thermal-vision.ts#L223-L259","documentation":"During thermal vision effect `setup`, `gl.createVertexArray()` returned `null`. A VAO could not be allocated, indicating context loss or GL resource exhaustion. The error fires after the program is created and shaders are deleted, before geometry upload.","triggerScenarios":"Context lost between program creation and VAO allocation; driver out of VAO resources; destroyed/degraded GL context.","commonSituations":"High concurrent webgl2 effect count; long sessions after a driver reset; restrictive headless WebGL2 backends.","solutions":["Reduce concurrent webgl2 effects.","Restart the render/session to reset GL state.","Verify headless browser WebGL2 support.","Handle `webglcontextlost` to recreate contexts."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  thermalVision({...params});\n} catch (e) {\n  if (/Failed to create WebGL vertex array/.test((e as Error).message)) {\n    renderFallbackFrame();\n  } else throw e;\n}","preventionTips":["Reduce concurrent webgl2 effects to limit VAO pressure.","Listen for `webglcontextlost` and rebuild VAOs on restore.","Restart long-running sessions to release leaked GL resources."],"tags":["thermal-vision","webgl2","gpu","resource-exhaustion","context-lost","vao","setup"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}