{"record":{"id":"c3c29e82515d9a24","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-c3c29e","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/rings.ts","lineNumber":299,"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(`Rings 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(`Rings 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":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/rings.ts#L281-L317","documentation":"Internal error from the `rings()` effect's WebGL2 setup: `gl.createProgram()` returned `null` after both shaders compiled successfully. The driver refused to allocate a program object. Like the other `Failed to create WebGL *` errors this is an environment-level allocation failure (context loss, GPU resource exhaustion), not a param validation error.","triggerScenarios":"Mounting `rings()` on a canvas whose context was just lost; running many effects concurrently until the implementation-defined program limit is reached; rendering on a software WebGL2 backend under heavy memory pressure.","commonSituations":"Studio sessions with many stacked effect layers; CI runners with constrained GPU memory; systems resuming from sleep where the GPU context is in a bad state.","solutions":["Refresh the page or restart the render to obtain a fresh context.","Lower the count of simultaneously active effects.","Update GPU drivers or move to a hardware-accelerated environment.","Add a `webglcontextlost` listener so the effect is torn down and re-created on restore."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const supportsWebGL2Programs = (): boolean => {\n  try {\n    const c = document.createElement('canvas');\n    const gl = c.getContext('webgl2');\n    if (!gl) return false;\n    return !!gl.createProgram();\n  } catch {\n    return false;\n  } finally {\n    /* canvas is GC'd */\n  }\n};","typeGuard":null,"tryCatchPattern":"try {\n  rings()({...});\n} catch (err) {\n  if (err instanceof Error && /Failed to create WebGL program/.test(err.message)) {\n    // treat as transient GPU resource failure; offer a reload\n  } else {\n    throw err;\n  }\n}","preventionTips":["Feature-detect WebGL2 program allocation before mounting effects.","Reduce concurrent effect count to free program objects.","Handle `webglcontextlost` to rebuild programs on restore.","Use hardware acceleration in CI."],"tags":["webgl2","rings-effect","effects","gpu","environment","resource-allocation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}