{"record":{"id":"895d9e4f6c9cb24a","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-895d9e","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/noise-displacement.ts","lineNumber":428,"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`Noise displacement 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`Noise displacement program link failed: ${log ?? '(no log)'}`,\n\t\t);\n\t}\n\n\treturn program;\n};\n\nconst setupNoiseDisplacement = (\n\ttarget: HTMLCanvasElement,","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/noise-displacement.ts#L410-L446","documentation":"While linking the noiseDisplacement effect's compiled shaders into a WebGL program, gl.createProgram() returned null. The WebGL2 context compiled shaders successfully but cannot allocate a program object, indicating context degradation or severe resource exhaustion.","triggerScenarios":"During setupNoiseDisplacement, linkProgram calls gl.createProgram() which returns null. This happens after both shaders compiled successfully, indicating the context is alive but cannot create program objects.","commonSituations":"Context loss during setup; GPU memory exhaustion from many concurrent programs; driver bugs under load; headless environments with marginal WebGL2 support.","solutions":["Reduce concurrent WebGL effects to lower program allocation pressure.","Handle WebGL context loss and retry after restoration.","Update GPU drivers or use a more capable GPU.","Verify headless Chrome GPU configuration supports WebGL2 program creation."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // apply noiseDisplacement effect\n} catch (e) {\n  if (e instanceof Error && e.message.includes('WebGL program')) {\n    console.warn('WebGL program creation failed, falling back without noiseDisplacement');\n    // fallback rendering path\n  } else {\n    throw e;\n  }\n}","preventionTips":["Reduce the number of concurrent WebGL effects to avoid program allocation limits.","Handle WebGL context loss and retry rendering.","Ensure adequate GPU resources in the render environment."],"tags":["webgl","gpu","environment","noise-displacement","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}