{"record":{"id":"8973cdfdfec5111f","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-shader-8973cd","errorCode":null,"errorMessage":"Failed to create WebGL shader","messagePattern":"Failed to create WebGL shader","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/radial-progressive-blur/radial-progressive-blur-runtime.ts","lineNumber":42,"sourceCode":"\treadonly programHorizontal: WebGLProgram;\n\treadonly programVertical: WebGLProgram;\n\treadonly vao: WebGLVertexArrayObject;\n\treadonly vbo: WebGLBuffer;\n\treadonly textureSource: WebGLTexture;\n\treadonly textureIntermediate: WebGLTexture;\n\treadonly framebuffer: WebGLFramebuffer;\n\treadonly horizontal: RadialProgressiveBlurUniforms;\n\treadonly vertical: RadialProgressiveBlurUniforms;\n};\n\nconst compileShader = (\n\tgl: WebGL2RenderingContext,\n\ttype: number,\n\tsource: string,\n): WebGLShader => {\n\tconst shader = gl.createShader(type);\n\tif (!shader) {\n\t\tthrow new Error('Failed to create WebGL shader');\n\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(\n\t\t\t`Radial progressive blur 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,","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/radial-progressive-blur/radial-progressive-blur-runtime.ts#L24-L60","documentation":"Thrown by compileShader in radial-progressive-blur-runtime.ts when gl.createShader() returns null during setupRadialProgressiveBlur. Same allocation-failure family as the other effects' shader errors, specific to the radial-progressive-blur effect (which compiles two programs — horizontal and vertical).","triggerScenarios":"setupRadialProgressiveBlur calls compileShader for the horizontal or vertical pass; gl.createShader(type) returns null before any GLSL source is loaded.","commonSituations":"Headless Chrome without working shader allocation; context lost before setup; many WebGL2 effects compiled in one tab; virtualized GPU with a low shader-object cap; SwiftShader under load on Lambda.","solutions":["Probe shader allocation in the target environment before mounting radialProgressiveBlur.","Use the published Remotion Lambda Chrome layer with SwiftShader enabled.","Reduce concurrent WebGL2 effects.","Handle 'webglcontextlost' and remount on 'webglcontextrestored'.","Update the GPU driver on reproducible machines."],"exampleFix":"// before\nimport {radialProgressiveBlur} from '@remotion/effects';\nconst effect = radialProgressiveBlur();\n\n// after — detect shader allocation before mounting\nfunction canCompileShader(gl: WebGL2RenderingContext): boolean {\n  const s = gl.createShader(gl.VERTEX_SHADER);\n  if (s) gl.deleteShader(s);\n  return s !== null && !gl.isContextLost();\n}","handlingStrategy":"try-catch","validationCode":"function glCanCreateShader(gl: WebGL2RenderingContext): boolean {\n  if (gl.isContextLost()) return false;\n  const s = gl.createShader(gl.VERTEX_SHADER);\n  if (s) gl.deleteShader(s);\n  return s !== null;\n}","typeGuard":null,"tryCatchPattern":"try {\n  radialProgressiveBlur();\n} catch (err) {\n  if (/Failed to create WebGL shader/.test((err as Error).message)) {\n    // report WebGL2 unavailable; fall back to a non-GPU effect\n  }\n  throw err;\n}","preventionTips":["Feature-detect shader allocation in headless/CI environments.","On Lambda use the published Chrome for Testing layer.","Handle context-loss events and remount on restore.","Limit concurrent WebGL2 effects to stay under driver shader-object caps."],"tags":["webgl","gpu","radial-progressive-blur","shader","environment","headless"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}