{"record":{"id":"0856b749457327a0","repo":"remotion-dev/remotion","slug":"failed-to-create-program-0856b7","errorCode":null,"errorMessage":"Failed to create program","messagePattern":"Failed to create program","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/white-noise.ts","lineNumber":133,"sourceCode":"\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\tconst info = gl.getShaderInfoLog(shader) ?? 'Unknown shader compile error';\n\t\tgl.deleteShader(shader);\n\t\tthrow new Error(info);\n\t}\n\n\treturn shader;\n};\n\nconst createProgram = (\n\tgl: WebGL2RenderingContext,\n\tvertexSource: string,\n\tfragmentSource: string,\n): WebGLProgram => {\n\tconst vertex = compileShader(gl, gl.VERTEX_SHADER, vertexSource);\n\tconst fragment = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSource);\n\tconst program = gl.createProgram();\n\tif (!program) {\n\t\tthrow new Error('Failed to create program');\n\t}\n\n\tgl.attachShader(program, vertex);\n\tgl.attachShader(program, fragment);\n\tgl.linkProgram(program);\n\tgl.deleteShader(vertex);\n\tgl.deleteShader(fragment);\n\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst info = gl.getProgramInfoLog(program) ?? 'Unknown program link error';\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(info);\n\t}\n\n\treturn program;\n};\n\nconst createWhiteNoiseState = (","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/white-noise.ts#L115-L151","documentation":"White noise setup calls gl.createProgram to link its vertex+fragment shaders; a null return means the GL context could not allocate the program object, so the effect cannot form a runnable pipeline and throws. The shader objects themselves compiled fine — this is purely a context/resource allocation failure (lost context, program-object limit, software renderer).","triggerScenarios":"createProgram in white-noise.ts: gl.createProgram() returns null after both shaders compiled successfully.","commonSituations":"Context lost between shader compile and program create; too many program objects alive across many concurrent effects; headless renderer with incomplete WebGL2 program allocation; GPU memory pressure.","solutions":["Verify WebGL2 context health (non-null getContext('webgl2'), isContextLost() false) before rendering.","Use Remotion's bundled Chrome for headless rendering; avoid disabling the software GPU.","Reduce the number of simultaneously active WebGL effects to free program-object slots.","Recreate the composition on webglcontextlost so setup re-runs cleanly.","Update GPU drivers or move to a host with a fully conformant WebGL2 implementation."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const gl = document.createElement('canvas').getContext('webgl2');\nconst webglOk = gl != null && gl.createProgram() != null && !gl.isContextLost();","typeGuard":"const canCreateProgram = (): boolean => {\n  const gl = document.createElement('canvas').getContext('webgl2');\n  return gl != null && !gl.isContextLost() && gl.createProgram() != null;\n};","tryCatchPattern":"try {\n  return <VideoEffects effects={[whiteNoise({amount: 0.4})]} />;\n} catch (err) {\n  if (err instanceof Error && err.message === 'Failed to create program') {\n    return <Video />;\n  }\n  throw err;\n}","preventionTips":["Probe program-object allocation before mounting shader effects.","Render with Remotion's bundled Chromium; avoid disabling the GPU.","Reduce concurrent WebGL effects to free program slots.","Re-mount on webglcontextlost."],"tags":["webgl","gpu","shader","rendering","context-loss"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}