{"record":{"id":"7b2127bf52a6c761","repo":"remotion-dev/remotion","slug":"flannel-shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Flannel shader compile failed: ${log ?? '(no log)'}","messagePattern":"Flannel shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/flannel.ts","lineNumber":202,"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(`Flannel shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst setupFlannel = (target: HTMLCanvasElement): FlannelState => {\n\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('flannel effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\tconst vertexShader = compileShader(gl, gl.VERTEX_SHADER, FLANNEL_VS);\n\tconst fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, FLANNEL_FS);","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/flannel.ts#L184-L220","documentation":"Thrown when the flannel GLSL fragment/vertex shader fails to compile. The error appends the GPU's info log, which pinpoints the offending line. This indicates a bug in the bundled shader source, a GLSL feature unsupported by the device, or a corrupted shader string.","triggerScenarios":"A bug in the shipped FLANNEL_VS/FLANNEL_FS source (regression after editing); a device/driver that rejects a GLSL ES 3.00 construct used by the shader; the shader string was inadvertently truncated.","commonSituations":"Developing the flannel shader and introducing a syntax error; running on an older GPU whose GLSL ES 300 support is partial; an extension was disabled that the shader relies on.","solutions":["Read the appended info log to find the offending GLSL line.","Report the issue with the full log and Chrome/GPU info to the Remotion maintainers if using a released version.","Reproduce in Remotion Studio locally to confirm whether it is environment-specific."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  effect = flannel(params);\n} catch (err) {\n  if (/shader compile failed/i.test(String(err))) {\n    console.error('Flannel shader compile failure; report log:', String(err));\n  }\n  throw err;\n}","preventionTips":["If you fork/edit the flannel shader, mirror GLSL ES 300 syntax exactly and test in Remotion Studio first.","Capture and forward the GPU info log when reporting issues.","Pin a known-good Remotion version if a regression is suspected."],"tags":["webgl","flannel","shader","compile","glsl"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}