{"record":{"id":"322ddf18fe12cbb4","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-322ddf","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/blur/blur-runtime.ts","lineNumber":59,"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(`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(`Program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn program;\n};\n\nconst createProgram = (\n\tgl: WebGL2RenderingContext,\n\tvertexSource: string,\n\tfragmentSource: string,","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/blur/blur-runtime.ts#L41-L77","documentation":"Thrown by the blur effect's `linkProgram` helper when `gl.createProgram()` returns `null`. This is a resource-allocation failure: the GL implementation could not create another program object. Distinct from a link failure (which happens after linking); here the program handle was never allocated.","triggerScenarios":"Fires at line 58-59 inside `linkProgram`, called from `createProgram` for the horizontal and vertical blur programs. Occurs when `gl.createProgram()` yields null.","commonSituations":"Context loss during blur setup; program-object cap exhausted by many live effects; software renderer with low limits.","solutions":["Guard with `gl.isContextLost()` and reinitialize on restoration.","Free unused blur states via `cleanupBlur` (deletes both programs).","Reduce the number of concurrently active WebGL effects.","Ensure hardware-accelerated WebGL2; update drivers."],"exampleFix":"if (gl.isContextLost()) {\n  // reinitialize after webglcontextrestored\n} else {\n  const state = setupBlur(canvas);\n}","handlingStrategy":"try-catch","validationCode":"if (gl.isContextLost()) { /* skip setupBlur */ }","typeGuard":null,"tryCatchPattern":"try {\n  const state = setupBlur(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 cleanupBlur on unused states.","Handle context-loss events.","Limit concurrent effects."],"tags":["webgl2","program","blur","gpu-memory","context-loss"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}