{"id":"26209c0fef92f60c","repo":"gohugoio/hugo","slug":"missing-taxonomy-s","errorCode":null,"errorMessage":"missing taxonomy: %s","messagePattern":"missing taxonomy: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/content_map_page.go","lineNumber":1189,"sourceCode":"\n\tfor _, viewName := range m.cfg.taxonomyConfig.views {\n\t\tkey := viewName.pluralTreeKey\n\t\ttaxonomies[viewName.plural] = make(page.Taxonomy)\n\t\tw := &doctree.NodeShiftTreeWalker[contentNode]{\n\t\t\tTree:     m.treePages,\n\t\t\tPrefix:   paths.AddTrailingSlash(key),\n\t\t\tLockType: doctree.LockTypeRead,\n\t\t\tHandle: func(s string, n contentNode) (radix.WalkFlag, error) {\n\t\t\t\tp := n.(*pageState)\n\n\t\t\t\tswitch p.Kind() {\n\t\t\t\tcase kinds.KindTerm:\n\t\t\t\t\tif !p.m.shouldList(true) {\n\t\t\t\t\t\treturn radix.WalkContinue, nil\n\t\t\t\t\t}\n\t\t\t\t\ttaxonomy := taxonomies[viewName.plural]\n\t\t\t\t\tif taxonomy == nil {\n\t\t\t\t\t\treturn radix.WalkStop, fmt.Errorf(\"missing taxonomy: %s\", viewName.plural)\n\t\t\t\t\t}\n\t\t\t\t\tif p.m.term == \"\" {\n\t\t\t\t\t\tpanic(\"term is empty\")\n\t\t\t\t\t}\n\t\t\t\t\tk := strings.ToLower(p.m.term)\n\n\t\t\t\t\terr := m.treeTaxonomyEntries.WalkPrefix(\n\t\t\t\t\t\tdoctree.LockTypeRead,\n\t\t\t\t\t\tpaths.AddTrailingSlash(s),\n\t\t\t\t\t\tfunc(ss string, wn *weightedContentNode) (bool, error) {\n\t\t\t\t\t\t\ttaxonomy[k] = append(taxonomy[k], page.NewWeightedPage(wn.weight, wn.n.(page.Page), wn.term.Page()))\n\t\t\t\t\t\t\treturn false, nil\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn radix.WalkStop, err\n\t\t\t\t\t}\n","sourceCodeStart":1171,"sourceCodeEnd":1207,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/hugolib/content_map_page.go#L1171-L1207","documentation":"Raised in pageMap.CreateSiteTaxonomies (hugolib/content_map_page.go:1189) while walking term pages: a page of kind 'term' was found under a taxonomy view whose entry is missing from the taxonomies map being built. Since the map is seeded from the configured taxonomy views just above, hitting this indicates an inconsistency between the configured taxonomies and the term pages present in the content tree — essentially an internal invariant violation surfaced as an error rather than a panic.","triggerScenarios":"During site build when CreateSiteTaxonomies walks tree entries under a taxonomy's plural key and taxonomies[viewName.plural] is nil — e.g. taxonomy configuration and the page tree disagree about which taxonomy views exist.","commonSituations":"Unusual taxonomy configuration edits (renaming a taxonomy's plural form, disabling taxonomies via disableKinds while term pages still exist), stale content structures after config changes in hugo server without a restart, or a genuine Hugo bug in taxonomy bookkeeping.","solutions":["Check [taxonomies] in your site config: every taxonomy your content uses must be declared with consistent singular/plural forms.","If you recently changed taxonomy config or disableKinds, restart 'hugo server' (or run a clean build with 'hugo --gc') to rebuild the content map.","Remove or update front matter referencing a taxonomy you deleted from configuration.","If config and content are consistent and the error persists, report it as a bug to the Hugo repo with a minimal reproducer."],"exampleFix":"# before (hugo.toml) — taxonomy removed but term pages remain referenced\n[taxonomies]\ncategory = 'categories'\n\n# after — declare all taxonomies your content uses\n[taxonomies]\ncategory = 'categories'\ntag = 'tags'","handlingStrategy":"validation","validationCode":"// Ensure every taxonomy referenced in content is declared in hugo.toml\n[taxonomies]\n  tag = \"tags\"\n  category = \"categories\"\n// and check front matter keys match the plural names configured above","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare all taxonomies in site config before using them in front matter or `site.Taxonomies`","Remember `disableKinds`/per-language overrides can remove taxonomies — keep front matter consistent with the active config","Watch for singular/plural mismatches between the taxonomy key and the front matter field"],"tags":["hugo","taxonomy","build","internal-invariant"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}