{"record":{"id":"22812507071b239c","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-228125","errorCode":null,"errorMessage":"Failed to create WebGL program","messagePattern":"Failed to create WebGL program","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/corner-pin/corner-pin-runtime.ts","lineNumber":50,"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":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/corner-pin/corner-pin-runtime.ts#L32-L68","documentation":"Thrown by linkProgram in corner-pin-runtime.ts when gl.createProgram() returns null. The WebGL2 context was acquired and both shaders compiled, but the GPU could not allocate a program object. This is a resource-exhaustion or context-loss issue.","triggerScenarios":"During setupCornerPin, after both shaders compile, gl.createProgram() returns null.","commonSituations":"Too many WebGL programs across concurrent effects; GPU memory pressure; context lost between shader compilation and program creation; constrained software WebGL in headless/CI environments.","solutions":["Reduce concurrent WebGL effects to lower program allocation.","Verify context health with gl.isContextLost().","Use a GPU-capable rendering environment.","Handle webglcontextlost for recovery."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify context health before applying corner pin\nconst gl = target.getContext('webgl2');\nif (gl?.isContextLost()) {\n  // defer or skip\n}","typeGuard":null,"tryCatchPattern":"try {\n  cornerPin({...})(source, target);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Failed to create WebGL program') {\n    // GPU resource exhaustion or context loss\n  }\n  throw e;\n}","preventionTips":["Reduce concurrent WebGL effects to lower program allocation.","Check gl.isContextLost() before relying on WebGL effects.","Use a GPU-capable rendering environment.","Handle webglcontextlost to reinitialize after recovery."],"tags":["webgl","effects","corner-pin","gpu","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}