{"record":{"id":"fb0b2fa34560c5d3","repo":"remotion-dev/remotion","slug":"failed-to-create-program","errorCode":null,"errorMessage":"Failed to create program","messagePattern":"Failed to create program","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/tv-signal-off.ts","lineNumber":158,"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 createTvSignalOffState = (","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/tv-signal-off.ts#L140-L176","documentation":"Thrown by the tv-signal-off effect's createProgram helper when gl.createProgram() returns null after both vertex and fragment shaders compiled successfully. createProgram returns null only when the GL context is lost or has exhausted its internal object table. The library aborts immediately since linking requires a valid program handle.","triggerScenarios":"Both shaders in createProgram compiled without error, but gl.createProgram() returns null. This happens when the WebGL2 context transitions to a lost state between shader compilation and program creation, or when the driver refuses to allocate another program object due to resource limits.","commonSituations":"GPU driver crash or context loss mid-setup during a long render; headless rendering environments with SwiftShader that enforce strict object limits; running dozens of effects concurrently on a single GPU.","solutions":["Reduce concurrent render load to keep GL context object counts within driver limits","Register a webglcontextlost listener and re-run the render after the context is restored","Ensure GPU drivers are up to date and the rendering environment provides a stable GL implementation","If rendering server-side, increase available GPU memory or switch to a GPU instance with more VRAM"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  renderWithEffect(canvas, tvSignalOff({amount: 1}));\n} catch (err) {\n  if (err instanceof Error && err.message === 'Failed to create program') {\n    // GL context lost after shader compilation — context is unrecoverable here.\n    // Restart the render process or browser instance.\n    await restartRenderProcess();\n  } else {\n    throw err;\n  }\n}","preventionTips":["Listen for webglcontextlost on the rendering canvas to detect context degradation early","Limit the number of simultaneously active WebGL2 effects to stay within driver program-object limits","Restart browser instances periodically in long-running render workers to avoid GL state degradation"],"tags":["webgl","gpu","tv-signal-off","context-loss","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}