{"id":"13674bc60b6f1227","repo":"gohugoio/hugo","slug":"v-failed-to-render-pages-w","errorCode":null,"errorMessage":"%v failed to render pages: %w","messagePattern":"(.+?) failed to render pages: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/site_render.go","lineNumber":118,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t\treturn radix.WalkContinue, nil\n\t\t},\n\t}\n\n\tif err := w.Walk(context.Background()); err != nil {\n\t\treturn err\n\t}\n\n\tclose(pages)\n\n\twg.Wait()\n\n\tclose(results)\n\n\terr := <-errs\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%v failed to render pages: %w\", s.resolveDimensionNames(), err)\n\t}\n\treturn nil\n}\n\nfunc pageRenderer(\n\tctx *siteRenderContext,\n\ts *Site,\n\tpages <-chan *pageState,\n\tresults chan<- error,\n\twg *sync.WaitGroup,\n) {\n\tdefer wg.Done()\n\n\tsendErr := func(err error) bool {\n\t\tselect {\n\t\tcase results <- err:\n\t\t\treturn true\n\t\tcase <-s.h.Done():","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/hugolib/site_render.go#L100-L136","documentation":"This wraps the first error returned by any of Hugo's concurrent page-render workers for one site dimension (language/version). `s.resolveDimensionNames()` prefixes which site variant failed, and `%w` carries the underlying template-execution or output-writing error. It means the render phase for that site aborted after a worker reported a failure.","triggerScenarios":"During `hugo` / `hugo server` builds, in `Site.renderPages`: a `pageRenderer` goroutine fails executing a layout template (undefined function, nil pointer in template, bad partial), fails an output-format render, or fails writing to the destination filesystem; the first error from the `errs` channel is wrapped here.","commonSituations":"Template errors in `layouts/` (calling methods on nil `.Params` values, deprecated template funcs after a Hugo upgrade), themes incompatible with the current Hugo version, front matter missing fields a template dereferences, or disk-full/permission errors on the `public/` directory.","solutions":["Read the wrapped error after the dimension name — it names the template file and line; fix that template or the page's front matter.","Run `hugo -v` or `hugo --panicOnWarning` locally to reproduce and get the full error chain for the failing page.","If it appeared after upgrading Hugo, check the release notes for removed template functions or layout-resolution changes and update the theme.","Check the failing language/version prefix — if only one language fails, inspect that language's content and i18n files."],"exampleFix":"<!-- before: layouts/page.html -->\n{{ .Params.author.name }}\n<!-- after -->\n{{ with .Params.author }}{{ .name }}{{ end }}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := h.Build(hugolib.BuildCfg{})\nif err != nil {\n    // wraps the underlying template/page error — unwrap for the root cause\n    log.Fatalf(\"site build failed: %v\", err)\n}","preventionTips":["Treat this as a wrapper: inspect the wrapped error (errors.Unwrap / %+v) for the failing template and page","Run hugo with --printPathWarnings and verbose logging to localize the failing page","Test template changes on a minimal site before full builds","Keep templates free of nil-unsafe accesses (use `with`/`default`) so per-page rendering can't fail"],"tags":["hugo","templates","rendering","build"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}