{"record":{"id":"e2e6883c9fa38494","repo":"remotion-dev/remotion","slug":"shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Shader compile failed: ${log ?? '(no log)'}","messagePattern":"Shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/barrel-distortion/barrel-distortion-runtime.ts","lineNumber":36,"sourceCode":"\t};\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(`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":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/barrel-distortion/barrel-distortion-runtime.ts#L18-L54","documentation":"Thrown by `compileShader` when `gl.getShaderParameter(shader, gl.COMPILE_STATUS)` is falsy — the GLSL source failed to compile. The shader's info log is read via `gl.getShaderInfoLog`, the shader is deleted, and the log (or '(no log)') is included in the message. This is a GLSL syntax/type/linking-attribute error in the shader source.","triggerScenarios":"The barrel-distortion vertex or fragment shader source (BARREL_DISTORTION_VS / BARREL_DISTORTION_FS) contains a GLSL error, or a modified/custom shader source is invalid for the GLSL ES version targeted by the WebGL2 context. The compiler rejects it and the info log is surfaced.","commonSituations":"Editing the barrel-distortion shaders and introducing a syntax/type error; using a GLSL ES 3.00 feature inconsistently; a typo in a uniform/attribute name; a driver-specific GLSL quirk rejecting valid-looking code.","solutions":["Read the info log in the error message — it names the line and the GLSL error.","Fix the reported GLSL line in the shader source and rebuild the effects package.","Validate GLSL against the target version (GLSL ES 3.00 for WebGL2) using a tool like glslang before running.","If the log says '(no log)', suspect a driver/context issue — test on another GPU/browser."],"exampleFix":"// before (shader had a type mismatch)\nuniform float uAmount; // used as vec2 elsewhere\n\n// after\nuniform vec2 uAmount;","handlingStrategy":"try-catch","validationCode":"// offline GLSL validation before runtime\nconst validateShader = (gl: WebGL2RenderingContext, type: number, src: string) => {\n  const s = gl.createShader(type)!;\n  gl.shaderSource(s, src); gl.compileShader(s);\n  const ok = gl.getShaderParameter(s, gl.COMPILE_STATUS);\n  const log = gl.getShaderInfoLog(s);\n  gl.deleteShader(s);\n  return ok ? null : log;\n};","typeGuard":"const compiles = (gl: WebGL2RenderingContext, type: number, src: string): boolean => {\n  const s = gl.createShader(type); if (!s) return false;\n  gl.shaderSource(s, src); gl.compileShader(s);\n  const ok = Boolean(gl.getShaderParameter(s, gl.COMPILE_STATUS));\n  gl.deleteShader(s); return ok;\n};","tryCatchPattern":"try {\n  compileShader(gl, type, src);\n} catch (e) {\n  console.error('GLSL error:', String(e)); // log contains the line\n  throw e;\n}","preventionTips":["Validate GLSL with glslang before runtime.","Read the info log — it pinpoints the offending line.","Keep shaders GLSL ES 3.00-compatible for WebGL2."],"tags":["webgl","glsl","effects","barrel-distortion","shader-compile"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}