{"record":{"id":"fbf1f3631f6869bb","repo":"remotion-dev/remotion","slug":"pixelate-shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Pixelate shader compile failed: ${log ?? '(no log)'}","messagePattern":"Pixelate shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/pixelate.ts","lineNumber":95,"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(`Pixelate 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":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/pixelate.ts#L77-L113","documentation":"Thrown by compileShader in pixelate.ts when gl.getShaderParameter(shader, gl.COMPILE_STATUS) is false after gl.compileShader. The shader source is hardcoded by the library, so a compile failure means the GLSL ES 3.00 source is rejected by the specific driver/implementation, not that the user wrote bad GLSL. The info log is captured before the shader is deleted and included in the message.","triggerScenarios":"pixelate setup compiles VERTEX_SHADER or FRAGMENT_SHADER (both `#version 300 es`); the driver reports COMPILE_STATUS=false and returns a non-empty info log. The thrown message interpolates that log verbatim.","commonSituations":"A GPU/driver that does not fully support GLSL ES 3.00 (rare on modern Chrome but possible on old mobile GPUs or stripped virtual GPUs); a Chrome flag or SwiftShader build with restricted shader support; corruption from a custom Chrome for Testing build; very rarely, a library regression that shipped invalid GLSL.","solutions":["Read the interpolated info log in the error message — it names the line and the GLSL error, which tells you whether it is a driver quirk or a library bug.","Reproduce in stable desktop Chrome; if it works there, the rendering environment (Lambda/CI/mobile) is the cause.","On Lambda, ensure you use the bundled Chrome for Testing layer rather than a custom Chromium that strips GLSL support.","Update the GPU driver or switch to SwiftShader software rendering consistently.","If the log shows a real GLSL error, file a Remotion issue with the full log and effect version — the shipped shader source is wrong."],"exampleFix":"// before\nimport {pixelate} from '@remotion/effects';\nconst effect = pixelate();\n// throws 'Pixelate shader compile failed: ERROR: 0:1: ...'\n\n// after — capture the driver info log for diagnosis\ntry {\n  const effect = pixelate();\n} catch (err) {\n  console.error('pixelate GLSL compile failed; driver info:', (err as Error).message);\n  console.error('webgl renderer:', document.createElement('canvas').getContext('webgl2')?.getParameter(/* UNMASKED_RENDERER */ 0x9246 as number));\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  pixelate();\n} catch (err) {\n  const msg = (err as Error).message;\n  if (msg.startsWith('Pixelate shader compile failed')) {\n    const dbg = canvas.getContext('webgl2')?.getExtension('WEBGL_debug_renderer_info');\n    const renderer = dbg && canvas.getContext('webgl2')?.getParameter(dbg.UNMASKED_RENDERER_WEBGL);\n    console.error(msg, 'renderer:', renderer);\n    // fall back to a non-GPU pipeline or escalate to the user\n  }\n  throw err;\n}","preventionTips":["Always log the interpolated info log — it pinpoints the failing GLSL line.","Reproduce shader-compile failures on stable desktop Chrome to isolate environment issues.","Use the published Remotion Lambda Chrome layer rather than custom Chromium builds.","Keep GPU drivers current; roll back if an update coincides with new failures.","Report reproducible genuine GLSL errors to Remotion with the full info log."],"tags":["webgl","glsl","shader","pixelate","driver","diagnostics"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}