{"record":{"id":"e51a06211d193317","repo":"remotion-dev/remotion","slug":"levels-shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Levels shader compile failed: ${log ?? '(no log)'}","messagePattern":"Levels shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/levels.ts","lineNumber":169,"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 levels 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(`Levels shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst createProgram = (gl: WebGL2RenderingContext): WebGLProgram => {\n\tconst vertexShader = compileShader(gl, gl.VERTEX_SHADER, VERTEX_SHADER);\n\tconst fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);\n\tconst program = gl.createProgram();\n\tif (!program) {\n\t\tthrow new Error('Failed to create levels shader program');\n\t}\n\n\tgl.attachShader(program, vertexShader);\n\tgl.attachShader(program, fragmentShader);\n\tgl.linkProgram(program);\n\tgl.deleteShader(vertexShader);\n\tgl.deleteShader(fragmentShader);","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/levels.ts#L151-L187","documentation":"Thrown by `compileShader()` in the levels effect when `gl.getShaderParameter(shader, gl.COMPILE_STATUS)` is false. The bundled GLSL (VERTEX_SHADER / FRAGMENT_SHADER) failed to compile, and the driver's info log is appended. Because the shaders are static and shipped with the package, a compile failure almost always points to a driver/GPU bug or a non-conformant WebGL2 implementation rather than user input.","triggerScenarios":"A GPU driver with incomplete GLSL ES 3.00 support; swiftshader/llvmpipe software rasterizers rejecting an instruction; a Chromium regression; running under a virtual display without proper WebGL2 backing.","commonSituations":"CI runners on software rasterizers; older mobile GPU drivers; a browser/Chromium downgrade that introduced a GLSL compiler regression; containers without a GPU device.","solutions":["Update the GPU driver / Chromium / Remotion to the latest version — shader regressions are frequently fixed upstream.","Switch the headless renderer to a GPU-backed Chrome or a newer swiftshader that supports GLSL ES 3.00.","Capture the `log` string in the error message and report it with the GPU/driver version to the Remotion issue tracker.","As a stopgap, disable the `levels()` effect on the affected composition and re-render."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  levels({...})(...);\n} catch (err) {\n  if (/Levels shader compile failed/.test(String(err))) {\n    // driver/shader bug: log the GLSL info log and skip the effect\n    console.error('levels() shader compile failure:', String(err));\n  } else {\n    throw err;\n  }\n}","preventionTips":["Pin a known-good Chromium/GPU combination for rendering.","Capture and report the appended info log instead of silently retrying — re-running identical shaders won't help.","Keep @remotion/effects updated so you get shader fixes."],"tags":["levels","webgl2","glsl","shader-compile","gpu-driver","render-env"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}