{"record":{"id":"c91fd3bb57dc14e2","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-c91fd3","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/outline.ts","lineNumber":360,"sourceCode":"\t}\n};\n\nconst setupOutline = (target: HTMLCanvasElement): OutlineState => {\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('outline effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl);\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\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(\n\t\tgl.ARRAY_BUFFER,\n\t\tnew Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),\n\t\tgl.STATIC_DRAW,\n\t);\n\n\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');\n\tgl.enableVertexAttribArray(aPos);","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/effects/src/outline.ts#L342-L378","documentation":"During setupOutline(), gl.createVertexArray() returned null, meaning the WebGL2 context cannot allocate a VAO - a lost context is the only spec-level cause. The outline effect uses the VAO to bind its fullscreen-quad vertex buffer, so setup aborts before any drawing happens.","triggerScenarios":"Applying outline() on a lost/degraded WebGL2 context, typically after heavy GPU object churn in the same page (many effect setups in a concurrent render).","commonSituations":"Long concurrent renders with many outline() frames; GPU resets; memory pressure in headless Chrome. Nearly always environmental, not compositional.","solutions":["Re-run the render - fresh page, fresh context","Lower --concurrency to reduce simultaneous WebGL state per Chrome profile","Update Chrome and GPU drivers","Report persistent, deterministic reproduction to Remotion with Chrome version details"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await renderMedia({composition, codec: 'h264'});\n} catch (err) {\n  if (err instanceof Error && err.message === 'Failed to create WebGL vertex array') {\n    await renderMedia({composition, codec: 'h264'}); // fresh page -> fresh context\n  } else {\n    throw err;\n  }\n}","preventionTips":["Keep concurrent WebGL-heavy frames low","Use a fresh Chrome instance per render job in CI","Update GPU drivers when the error recurs on the same host"],"tags":["remotion","effects","webgl","context-lost","vao","outline","gpu"],"backgroundTag":"webgl-context-lost","analyzedSha":"10db9de07356446fb0edb3c3ae211369b693d18b","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}