{"record":{"id":"0a855f6cbefe7213","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-0a855f","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/burlap.ts","lineNumber":260,"sourceCode":"\tgl.shaderSource(shader, source);\n\tgl.compileShader(shader);\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\tconst log = gl.getShaderInfoLog(shader);\n\t\tgl.deleteShader(shader);\n\t\tthrow new Error(`Burlap shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst linkProgram = (\n\tgl: WebGL2RenderingContext,\n\tvs: WebGLShader,\n\tfs: WebGLShader,\n): WebGLProgram => {\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, vs);\n\tgl.attachShader(program, fs);\n\tgl.linkProgram(program);\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(`Burlap program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn program;\n};\n\nconst setupBurlap = (target: HTMLCanvasElement): BurlapState => {\n\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/burlap.ts#L242-L278","documentation":"Thrown by burlap's `linkProgram` when `gl.createProgram()` returns `null`. A resource-allocation failure: the GL implementation could not create another program object. Distinct from a link-status failure (handled at line 269).","triggerScenarios":"Fires at line 258-260 inside `linkProgram`, called from `setupBurlap`, when `gl.createProgram()` returns null.","commonSituations":"Context loss during burlap setup; program-object cap reached by many live effects; software renderer with low limits.","solutions":["Guard with `gl.isContextLost()`; reinitialize on restoration.","Free unused burlap states via burlap `cleanup`.","Reduce concurrent WebGL effects.","Ensure hardware-accelerated WebGL2; update drivers."],"exampleFix":"if (gl.isContextLost()) {\n  // reinitialize after webglcontextrestored\n} else {\n  burlap.setup(canvas);\n}","handlingStrategy":"try-catch","validationCode":"if (gl.isContextLost()) { /* skip setupBurlap */ }","typeGuard":null,"tryCatchPattern":"try {\n  burlap.setup(canvas);\n} catch (err) {\n  if (/Failed to create WebGL program/.test(err.message)) {\n    // await restore or reduce effects, then retry\n  } else { throw err; }\n}","preventionTips":["Release programs via burlap cleanup on unused states.","Handle context-loss events.","Limit concurrent effects."],"tags":["webgl2","program","burlap","gpu-memory","context-loss"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}