{"record":{"id":"99a022a342df63b5","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-99a022","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/drop-shadow/drop-shadow-runtime.ts","lineNumber":79,"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(`Drop shadow 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(`Drop shadow 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":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/drop-shadow/drop-shadow-runtime.ts#L61-L97","documentation":"Thrown by the drop-shadow runtime's linkProgram helper when gl.createProgram() returns null. As with the shader case, a null program means the WebGL2 context could not allocate another program — context loss or per-context resource exhaustion. The drop-shadow runtime builds four programs, so the first allocation that fails throws.","triggerScenarios":"Lost WebGL2 context, exhausted program limit, or GPU memory pressure. Reached inside setupDropShadow() via createProgram() after shaders compile.","commonSituations":"Many drop-shadow instances leaking programs (cleanup skipped); long Studio sessions; GPU driver crash; headless rendering with a constrained software GL backend.","solutions":["Ensure every drop-shadow instance has cleanupDropShadow invoked (the framework runs cleanup on unmount; do not short-circuit the effect lifecycle).","Reduce the number of simultaneously mounted drop-shadow effects.","Reload to release leaked programs; update GPU drivers.","For headless runs, use a software renderer with adequate memory."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const supportsWebGL2 = () => {\n  try {\n    return !!document.createElement('canvas').getContext('webgl2');\n  } catch {\n    return false;\n  }\n};","typeGuard":null,"tryCatchPattern":"try {\n  state = setupDropShadow(canvas);\n} catch (err) {\n  if (err instanceof Error && /WebGL program/i.test(err.message)) {\n    console.error('Drop-shadow program allocation failed:', err.message);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Ensure cleanupDropShadow runs so programs are deleted between mounts.","Limit the number of simultaneous drop-shadow effects.","Reload to reclaim leaked resources; keep drivers current.","Use SwiftShader with adequate memory in headless environments."],"tags":["webgl2","drop-shadow","program","gpu","runtime","resource-leak"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}