{"record":{"id":"fab0d1cee64b3f45","repo":"remotion-dev/remotion","slug":"gridlines-shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Gridlines shader compile failed: ${log ?? '(no log)'}","messagePattern":"Gridlines shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/gridlines.ts","lineNumber":373,"sourceCode":"}\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(`Gridlines 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);","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/gridlines.ts#L355-L391","documentation":"Thrown by gridlines' compileShader when the shader compiled but gl.getShaderParameter(shader, COMPILE_STATUS) is false. The driver's info log is appended, so the message tells you the exact GLSL error. Because GRIDLINES_VS/GRIDLINES_FS are hardcoded GLSL ES 3.00 strings, a compile failure usually means the environment does not support the shader rather than a user-param mistake.","triggerScenarios":"Setup-time compile of GRIDLINES_VS or GRIDLINES_FS under a WebGL2 context whose driver rejects the GLSL. Typical logs: unsupported version directive (#version 300 es on a context that isn't real WebGL2), precision/qualifier errors on a buggy driver, or a driver that strips a built-in the shader relies on.","commonSituations":"A runtime that reports WebGL2 support but delegates to an incomplete software renderer; outdated mobile GPU drivers; ANGLE/SwiftShader version mismatches in headless Chrome; a browser extension or GPU blocklist downgrading the renderer.","solutions":["Read the appended info log to find the offending GLSL line/feature.","Run the composition in a current desktop Chrome with hardware acceleration enabled to confirm the shader compiles there.","For headless rendering, use a headless shell with a functional WebGL2 backend (e.g. --use-gl=angle --use-angle=swiftshader) and update it.","Update GPU drivers / ANGLE; if the GPU is blocklisted, force a working backend via flags."],"exampleFix":"// before: headless shell without WebGL2 backend -> 'Gridlines shader compile failed: ...'\nchrome --headless --disable-gpu\n\n// after: provide a WebGL2-capable software backend\nchrome --headless=new --use-gl=angle --use-angle=swiftsoftware","handlingStrategy":"try-catch","validationCode":"// Confirm real WebGL2 with a working compiler before running the effect\nconst gl = canvas.getContext('webgl2');\nif (!gl) throw new Error('WebGL2 unavailable');\nif (gl.isContextLost()) throw new Error('WebGL2 context lost');","typeGuard":"null","tryCatchPattern":"try {\n  gridlines.setup(canvas);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Gridlines shader compile failed')) {\n    // read the GLSL log, switch to a conformant backend / update drivers\n  }\n  throw e;\n}","preventionTips":["Use a current desktop Chrome with hardware acceleration for development.","For headless, use a WebGL2-capable backend (ANGLE/SwiftShader).","Keep GPU drivers and the headless shell updated.","Address any GPU blocklist entries rather than bypassing them."],"tags":["webgl","gridlines-effect","shader","glsl","gpu"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}