{"id":"e93e3101e0a5e84e","repo":"gohugoio/hugo","slug":"failed-to-create-term-page-q-w","errorCode":null,"errorMessage":"failed to create term page %q: %w","messagePattern":"failed to create term page %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/content_map_page_assembler.go","lineNumber":873,"sourceCode":"\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\tif len(v) > 0 {\n\t\t\t\t\tp := &pageMetaSource{\n\t\t\t\t\t\tpathInfo:        pi,\n\t\t\t\t\t\tsitesMatrixBase: v,\n\t\t\t\t\t\tpageConfigSource: &pagemeta.PageConfigEarly{\n\t\t\t\t\t\t\tKind: kinds.KindTerm,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t\tvar n2 contentNode = p\n\t\t\t\t\tif found {\n\t\t\t\t\t\tn2 = contentNodes{n, p}\n\t\t\t\t\t}\n\t\t\t\t\tn2, ns, err := transformPages(termKey, n2, getCascades(pw.WalkContext, termKey))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"failed to create term page %q: %w\", termKey, err)\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch ns {\n\t\t\t\t\tcase doctree.NodeTransformStateReplaced:\n\t\t\t\t\t\tpw.Tree.InsertRaw(termKey, n2)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n\n\tpw.Transform = func(s string, n contentNode) (n2 contentNode, ns doctree.NodeTransformState, err error) {\n\t\tn2, ns, err = transformPagesAndCreateMissingStructuralNodes(s, n, false)\n\n\t\tif err != nil || ns >= doctree.NodeTransformStateSkip {\n\t\t\treturn","sourceCodeStart":855,"sourceCodeEnd":891,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/hugolib/content_map_page_assembler.go#L855-L891","documentation":"Raised in hugolib/content_map_page_assembler.go:873 while Hugo auto-generates taxonomy term pages. For each term collected from page front matter, Hugo builds a `pageMetaSource` of kind `term` and runs it through `transformPages`; if that transformation fails (cascade application, page-config validation, merging with an existing term page), the error is wrapped with the term's tree key (e.g. \"/tags/foo\").","triggerScenarios":"Builds of sites with taxonomies where creating or merging a specific term page fails — e.g. a cascade targeting term pages carries invalid values, a manually created term page (content/tags/foo/_index.md) has bad front matter that conflicts during merge, or the term key itself produces an invalid page config.","commonSituations":"Invalid `cascade` blocks in taxonomy `_index.md` files or site config that apply to term pages; malformed front matter in a term's own `_index.md`; unusual term values in page front matter (odd characters/types) producing bad paths; regressions after changing taxonomy config.","solutions":["Look at the quoted term key in the error to identify which taxonomy term failed, then inspect the wrapped cause after the colon.","Fix the front matter of that term's `_index.md` (if one exists) or the cascade that applies to term pages.","Check pages that declare the term in front matter for non-string/odd values (e.g. a map where a string is expected in `tags`)."],"exampleFix":"# before (content/tags/_index.md)\n---\ncascade:\n  outputs: [bogus-format]\n---\n\n# after\n---\ncascade:\n  outputs: [html, rss]\n---","handlingStrategy":"validation","validationCode":"hugo --logLevel info  # check taxonomy warnings; ensure taxonomy terms are plain strings, not maps/objects","typeGuard":null,"tryCatchPattern":"if err := hugolib.Build(...); err != nil {\n    log.Fatalf(\"term page creation failed (check the quoted term's front matter and _index.md): %v\", err)\n}","preventionTips":["Keep taxonomy values in front matter as simple string lists (tags: [\"a\",\"b\"]), never nested objects","Check the term's _index.md under content/<taxonomy>/<term>/ for invalid front matter (bad dates, cascade)","Avoid terms whose names produce invalid/conflicting paths (e.g. differing only by case or slashes)"],"tags":["hugo","taxonomy","build","content"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}