{"record":{"id":"9b7606d2d5f72279","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-9b7606","errorCode":null,"errorMessage":"Failed to create WebGL program","messagePattern":"Failed to create WebGL program","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/flannel.ts","lineNumber":223,"sourceCode":"\treturn shader;\n};\n\nconst setupFlannel = (target: HTMLCanvasElement): FlannelState => {\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('flannel effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\tconst vertexShader = compileShader(gl, gl.VERTEX_SHADER, FLANNEL_VS);\n\tconst fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, FLANNEL_FS);\n\tconst program = gl.createProgram();\n\tif (!program) {\n\t\tthrow new Error('Failed to create WebGL program');\n\t}\n\n\tgl.attachShader(program, vertexShader);\n\tgl.attachShader(program, fragmentShader);\n\tgl.linkProgram(program);\n\tgl.deleteShader(vertexShader);\n\tgl.deleteShader(fragmentShader);\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst log = gl.getProgramInfoLog(program);\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(`Flannel program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\tconst vao = gl.createVertexArray();\n\tconst vbo = gl.createBuffer();\n\tif (!vao || !vbo) {\n\t\tthrow new Error('Failed to create WebGL geometry');\n\t}","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/flannel.ts#L205-L241","documentation":"Thrown by setupFlannel when gl.createProgram() returns null after the shaders compiled. WebGL2 returns null only on context loss or severe resource exhaustion, so this is a GPU-level allocation failure rather than a link error (link errors surface as 607).","triggerScenarios":"Lost WebGL context between shader compile and program creation; GPU memory exhausted by other effects/contexts; driver bug refusing to allocate the program object.","commonSituations":"Stacking many WebGL effects across sequences; rendering on resource-constrained headless Chrome; resumed render after GPU reset.","solutions":["Lower the concurrent WebGL effect count.","Retry the render job on a fresh Chrome process.","Use a machine/AMI with a healthier GPU or more VRAM."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"let effect;\nfor (let attempt = 0; attempt < 3; attempt++) {\n  try {\n    effect = flannel(params);\n    break;\n  } catch (err) {\n    if (attempt === 2 || !/WebGL|program/i.test(String(err))) throw err;\n    await new Promise((r) => setTimeout(r, 200 * (attempt + 1)));\n  }\n}","preventionTips":["Reduce concurrent WebGL effects to free GPU program objects.","Render on hosts with adequate GPU memory.","Retry transient context-loss failures on a fresh Chrome process."],"tags":["webgl","flannel","gpu","program","runtime"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}