{"record":{"id":"325a927b5b5ab50d","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-325a92","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/radial-progressive-blur/radial-progressive-blur-runtime.ts","lineNumber":65,"sourceCode":"\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\tconst log = gl.getShaderInfoLog(shader);\n\t\tgl.deleteShader(shader);\n\t\tthrow new Error(\n\t\t\t`Radial progressive blur shader compile failed: ${log ?? '(no log)'}`,\n\t\t);\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(\n\t\t\t`Radial progressive blur program link failed: ${log ?? '(no log)'}`,\n\t\t);\n\t}\n\n\treturn program;\n};\n\nconst createProgram = (\n\tgl: WebGL2RenderingContext,","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/radial-progressive-blur/radial-progressive-blur-runtime.ts#L47-L83","documentation":"After successfully compiling both vertex and fragment shaders, the effect calls gl.createProgram() to allocate a linked GPU program object. If the WebGL2 context returns null, the effect cannot proceed with linking and throws immediately. A null return signals that the GL context is lost, exhausted, or already destroyed.","triggerScenarios":"Calling setupRadialProgressiveBlur() when the WebGL2 context has been lost (e.g. after a GPU process crash or tab backgrounding on mobile), when the context's resource pool is exhausted, or when the context was externally destroyed between shader compilation and program creation.","commonSituations":"Mobile browsers that aggressively reclaim GPU memory; long-running renders with many simultaneous effects that exhaust GL object pools; switching GPU (hybrid laptops) mid-session; background tabs on power-constrained devices.","solutions":["Listen for the 'webglcontextlost' event on the canvas and reinitialize effects after 'webglcontextrestored'","Reduce the number of simultaneous WebGL effects in the composition","Ensure the render is running on a machine with a stable GPU context (not a headless environment with a fragile software rasterizer)","Retry the effect setup after context restoration"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"canvas.addEventListener('webglcontextlost', (e) => { e.preventDefault(); }, false);\ncanvas.addEventListener('webglcontextrestored', () => {\n  // re-initialize all WebGL effects here\n}, false);","preventionTips":["Always register webglcontextlost and webglcontextrestored handlers on the rendering canvas","Limit the number of simultaneous WebGL effects to stay within GPU resource pools","Dispose of effects and their GL resources when they are removed from the composition"],"tags":["webgl","gpu","context-lost","resource-exhaustion","radial-progressive-blur"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}