{"record":{"id":"8d15b1a4ec12350b","repo":"gohugoio/hugo","slug":"pandoc-not-found-in-path-cannot-render-q","errorCode":null,"errorMessage":"pandoc not found in $PATH, cannot render %q","messagePattern":"pandoc not found in \\$PATH, cannot render %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"markup/pandoc/convert.go","lineNumber":63,"sourceCode":"}\n\nfunc (c *pandocConverter) Convert(ctx converter.RenderContext) (converter.ResultRender, error) {\n\tb, err := c.getPandocContent(ctx.Src, c.ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn converter.Bytes(b), nil\n}\n\nfunc (c *pandocConverter) Supports(feature identity.Identity) bool {\n\treturn false\n}\n\n// getPandocContent calls pandoc as an external helper to convert pandoc markdown to HTML.\nfunc (c *pandocConverter) getPandocContent(src []byte, ctx converter.DocumentContext) ([]byte, error) {\n\tbinaryName := getPandocBinaryName()\n\tif binaryName == \"\" {\n\t\treturn nil, fmt.Errorf(\"pandoc not found in $PATH, cannot render %q\", ctx.DocumentName)\n\t}\n\targs := []string{\"--mathjax\", \"--citeproc\"}\n\treturn internal.ExternallyRenderContent(c.cfg, ctx, src, binaryName, args)\n}\n\nconst pandocBinary = \"pandoc\"\n\nfunc getPandocBinaryName() string {\n\tif hexec.InPath(pandocBinary) {\n\t\treturn pandocBinary\n\t}\n\treturn \"\"\n}\n\n// Supports returns whether Pandoc is installed on this computer.\nfunc Supports() bool {\n\thasBin := getPandocBinaryName() != \"\"\n\tif htesting.SupportsAll() {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/markup/pandoc/convert.go#L45-L81","documentation":"Returned by the pandoc converter when getPandocBinaryName() cannot find the 'pandoc' executable in $PATH (via hexec.InPath). Hugo shells out to pandoc as an external renderer, so if the binary is absent the .pandoc content file cannot be rendered and conversion aborts for that document.","triggerScenarios":"Rendering any content file mapped to the pandoc converter (extension resolved to the pandoc media type, or defaultMarkdownHandler/error path selecting pandoc) on a machine where `pandoc` is not on PATH. Fires from pandocConverter.getPandocContent -> Convert during the build.","commonSituations":"CI container or Docker image that did not install pandoc; local dev machine with pandoc installed via a package manager that didn't add it to PATH; deploying to a minimal Hugo image (e.g. the extended Alpine image) that only bundles Hugo; relying on pandoc in a theme without documenting the external dependency.","solutions":["Install pandoc and ensure it is on PATH: `apt-get install -y pandoc` (Debian/Ubuntu), `brew install pandoc` (macOS), `apk add --no-cache pandoc` (Alpine).","Verify with `pandoc --version` in the same shell/environment Hugo runs in.","If you do not need pandoc, stop routing content to it: remove/alter the media type mapping or switch defaultMarkdownHandler away from pandoc, and rename .pandoc files to .md.","For Docker builds add a pandoc install layer before the Hugo build step."],"exampleFix":"# Dockerfile before\nFROM hugomods/hugo:exts\n# pandoc missing -> render fails\n\n# after\nFROM hugomods/hugo:exts\nRUN apk add --no-cache pandoc","handlingStrategy":"validation","validationCode":"// Check pandoc availability before building.\nimport \"github.com/gohugoio/hugo/common/hexec\"\n\nfunc ensurePandoc() error {\n    if !hexec.InPath(\"pandoc\") {\n        return fmt.Errorf(\"pandoc not installed; install it or remove .pandoc content\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if _, err := pandocconv.Convert(rc); err != nil {\n    if strings.Contains(err.Error(), \"pandoc not found in $PATH\") {\n        // skip or report the document, do not abort the whole build\n    }\n}","preventionTips":["Add an `which pandoc` check to your build script and CI pipeline.","Document external binary dependencies (pandoc) in your project README.","Pin a pandoc version in your Dockerfile so CI is reproducible."],"tags":["pandoc","external-binary","path","rendering","environment"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}