{"record":{"id":"c4d494de8a954d66","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-c4d494","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/outline.ts","lineNumber":248,"sourceCode":"\t}\n\n\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(`Outline shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst createProgram = (gl: WebGL2RenderingContext): WebGLProgram => {\n\tconst vertexShader = compileShader(gl, gl.VERTEX_SHADER, OUTLINE_VS);\n\tconst fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, OUTLINE_FS);\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, vertexShader);\n\tgl.attachShader(program, fragmentShader);\n\tgl.linkProgram(program);\n\tgl.deleteShader(vertexShader);\n\tgl.deleteShader(fragmentShader);\n\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(`Outline program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn program;\n};\n\nconst createTexture = (gl: WebGL2RenderingContext): WebGLTexture => {","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/effects/src/outline.ts#L230-L266","documentation":"During outline() effect setup, gl.createProgram() returned null. Per the WebGL spec this only happens on a lost or otherwise invalid context - the two shaders compiled fine, but the program object could not be allocated. Like the other 'Failed to create WebGL ...' errors in outline.ts, it signals GPU resource exhaustion or a lost context rather than a usage mistake.","triggerScenarios":"Applying outline() after many WebGL objects were allocated in the same Chrome page (several effect-heavy frames rendered concurrently, or a previous context loss event) so program allocation fails.","commonSituations":"High-concurrency renders where each frame sets up its own outline() state; memory pressure in Lambda/serverless renders; GPU driver resets mid-render.","solutions":["Retry the render with lower concurrency so fewer WebGL contexts/programs are alive simultaneously","Restart the render - a fresh page usually gets a healthy context","Update Chrome and GPU drivers if the failure repeats on the same machine","Reduce the number of simultaneously mounted elements using outline() in one composition"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await renderMediaOnLambda(/* ... */);\n} catch (err) {\n  if (err instanceof Error && err.message === 'Failed to create WebGL program') {\n    // transient context loss: retry once, ideally at lower concurrency\n    await renderMediaOnLambda(/* ..., concurrency: 2 */);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Lower --concurrency on WebGL-heavy renders","Restart render hosts periodically for long-running fleets","Monitor for GPU resets in Chrome's chrome://gpu (or --enable-logging) on bare-metal renderers"],"tags":["remotion","effects","webgl","context-lost","outline","gpu"],"backgroundTag":"webgl-context-lost","analyzedSha":"10db9de07356446fb0edb3c3ae211369b693d18b","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}