{"record":{"id":"aea10e5d435d4f10","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-program-aea10e","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/starburst.ts","lineNumber":259,"sourceCode":"\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(`Starburst shader compile failed: ${log ?? '(no log)'}`);\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(`Starburst program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn program;\n};\n\nexport const starburst = createEffect<StarburstEffectParams, StarburstGlState>({\n\ttype: 'remotion/starburst',\n\tlabel: 'starburst()',\n\tdocumentationLink: 'https://www.remotion.dev/docs/effects/starburst',","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/starburst.ts#L241-L277","documentation":"During starburst effect `setup`, after both shaders compile successfully, `gl.createProgram()` returned `null`. This means the WebGL2 context could not allocate a program object, typically due to context loss or GPU resource exhaustion. The error fires before any shaders are attached.","triggerScenarios":"The WebGL2 context was lost between shader compilation and program creation; the driver exhausted its program object budget; the context is in a degraded/destroyed state.","commonSituations":"Many simultaneous webgl2 effect setups; long-running sessions after a GPU driver reset; headless environments with restrictive WebGL2 resource limits.","solutions":["Reduce the number of concurrent webgl2 effects in the render pipeline.","Restart the session/render to get a fresh context.","Ensure headless Chrome is launched with working WebGL2 (`--use-gl=angle`).","Listen for `webglcontextlost` and tear down / recreate effect state proactively."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Probe program creation ability on a throwaway context.\nconst canCreateProgram = (): boolean => {\n  try {\n    const gl = document.createElement('canvas').getContext('webgl2');\n    return !!gl?.createProgram();\n  } catch {\n    return false;\n  }\n};","typeGuard":null,"tryCatchPattern":"try {\n  starburst({...params});\n} catch (e) {\n  if (/Failed to create WebGL program/.test((e as Error).message)) {\n    renderFallbackFrame();\n  } else throw e;\n}","preventionTips":["Bound concurrent webgl2 effect count to avoid program-object exhaustion.","Handle `webglcontextlost`/`webglcontextrestored` to rebuild program state.","Restart long-running render sessions periodically to reclaim leaked GL objects."],"tags":["starburst","webgl2","gpu","resource-exhaustion","context-lost","setup"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}