{"record":{"id":"8d41cf871c7f4aab","repo":"remotion-dev/remotion","slug":"halftone-linear-gradient-shader-compile-failed","errorCode":null,"errorMessage":"Halftone linear gradient shader compile failed: ${log ?? '(no log)'}","messagePattern":"Halftone linear gradient shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/halftone-linear-gradient.ts","lineNumber":384,"sourceCode":"\tcachedColorRgba: ParsedColorRgba;\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`Halftone linear gradient 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,\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);","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/halftone-linear-gradient.ts#L366-L402","documentation":"Thrown by halftone-linear-gradient's compileShader when the shader compiled but COMPILE_STATUS is false. The driver info log is appended, so the message pinpoints the GLSL problem. Since the vertex/fragment sources are hardcoded GLSL ES 3.00, a compile failure usually reflects an environment/driver limitation rather than a user parameter.","triggerScenarios":"Setup-time compile of HALFTONE_LINEAR_GRADIENT_VS/FS under a WebGL2 context whose driver rejects the GLSL. Typical logs cite an unsupported version directive, precision/qualifier errors, or a missing built-in on a buggy driver; in headless setups it often means WebGL2 is reported but not actually backed by a conformant compiler.","commonSituations":"Headless Chrome without a real WebGL2 backend; outdated mobile GPU drivers; ANGLE/SwiftShader version mismatch; a GPU on the browser blocklist being used; a browser extension interfering with the GLSL compiler.","solutions":["Read the appended info log to find the offending GLSL line/feature.","Reproduce in current desktop Chrome with hardware acceleration to confirm the shader compiles there.","For headless, use a headless shell with a functional WebGL2 backend (e.g. --use-gl=angle --use-angle=swiftshader) and keep it current.","Update GPU drivers / ANGLE; address any blocklist entry."],"exampleFix":"// before: headless without WebGL2 compiler -> 'Halftone linear gradient shader compile failed: ...'\nchrome --headless --disable-gpu\n\n// after: provide a conformant WebGL2 software backend\nchrome --headless=new --use-gl=angle --use-angle=swiftsoftware","handlingStrategy":"try-catch","validationCode":"const gl = canvas.getContext('webgl2');\nif (!gl || gl.isContextLost()) {\n  throw new Error('No healthy WebGL2 context for halftone shader compile');\n}","typeGuard":"null","tryCatchPattern":"try {\n  halftoneLinearGradient.setup(canvas);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Halftone linear gradient shader compile failed')) {\n    // read the GLSL log, switch to a conformant backend / update drivers\n  }\n  throw e;\n}","preventionTips":["Develop in a current desktop Chrome with hardware acceleration.","For headless, use a WebGL2-capable backend (ANGLE/SwiftShader).","Keep GPU drivers and the headless shell updated.","Address GPU blocklist entries rather than bypassing them."],"tags":["webgl","halftone-linear-gradient-effect","shader","glsl","gpu"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}