{"record":{"id":"d91b4fb9f5caf36a","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-d91b4f","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/drop-shadow/drop-shadow-runtime.ts","lineNumber":166,"sourceCode":"\tconst programHorizontal = createProgram(\n\t\tgl,\n\t\tDROP_SHADOW_VS,\n\t\tDROP_SHADOW_BLUR_FS_HORIZONTAL,\n\t);\n\tconst programVertical = createProgram(\n\t\tgl,\n\t\tDROP_SHADOW_VS,\n\t\tDROP_SHADOW_BLUR_FS_VERTICAL,\n\t);\n\tconst programComposite = createProgram(\n\t\tgl,\n\t\tDROP_SHADOW_VS,\n\t\tDROP_SHADOW_COMPOSITE_FS,\n\t);\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":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/drop-shadow/drop-shadow-runtime.ts#L148-L184","documentation":"Thrown by setupDropShadow when gl.createVertexArray() returns null. A null VAO means the WebGL2 context is lost, destroyed, or resource-exhausted. Reached after the four programs are built, while constructing the shared fullscreen-quad geometry.","triggerScenarios":"Lost WebGL2 context, exhausted VAO object limit, or GPU memory pressure. Triggered inside setupDropShadow() during geometry allocation.","commonSituations":"Effects leaking VAOs (cleanup paths skipped); many drop-shadow instances; GPU driver crash; long Studio sessions; headless rendering with constrained software GL.","solutions":["Verify cleanupDropShadow runs (it calls gl.deleteVertexArray on unmount).","Cut down the number of WebGL2 effects mounted at once.","Reload to recover from a lost context; update GPU drivers.","Use SwiftShader with adequate memory for headless runs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const supportsWebGL2 = () => {\n  try {\n    return !!document.createElement('canvas').getContext('webgl2');\n  } catch {\n    return false;\n  }\n};","typeGuard":null,"tryCatchPattern":"try {\n  state = setupDropShadow(canvas);\n} catch (err) {\n  if (err instanceof Error && /vertex array/i.test(err.message)) {\n    console.error('Drop-shadow VAO allocation failed:', err.message);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Verify cleanupDropShadow runs (gl.deleteVertexArray) on unmount.","Limit simultaneous WebGL2 effects; reload to reclaim leaked VAOs.","Use SwiftShader with adequate memory in headless runs; update drivers."],"tags":["webgl2","drop-shadow","vertex-array","vao","gpu","runtime"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}