{"record":{"id":"159daddd32be8103","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-159dad","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/roughen-edges.ts","lineNumber":324,"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`Roughen edges 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(`Roughen edges program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn program;\n};\n\nconst createSourceTexture = (gl: WebGL2RenderingContext): WebGLTexture => {\n\tconst texture = gl.createTexture();\n\tif (!texture) {\n\t\tthrow new Error('Failed to create WebGL texture');","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/roughen-edges.ts#L306-L342","documentation":"Internal error from the `roughenEdges()` effect setup: `gl.createProgram()` returned `null` after both shaders compiled. The driver refused to allocate a program object. Environment-level allocation failure (context loss, GPU resource exhaustion), not a param error.","triggerScenarios":"Mounting `roughenEdges()` on a lost context; exhausting the driver's program-object pool with many concurrent effects; software GL backend under heavy memory load.","commonSituations":"Heavy Studio compositions; CI runners with constrained GPU memory; systems recovering from a GPU crash.","solutions":["Refresh the page or restart the render.","Cut down the number of simultaneously mounted effects.","Update drivers or move to a hardware-accelerated environment.","Add a `webglcontextlost`/`webglcontextrestored` handler to rebuild programs."],"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  }\n};","typeGuard":null,"tryCatchPattern":"try {\n  roughenEdges()({...});\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","roughen-edges-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"}