{"record":{"id":"053d460567961349","repo":"gohugoio/hugo","slug":"deletefunc-unknown-type-t","errorCode":null,"errorMessage":"DeleteFunc: unknown type %T","messagePattern":"DeleteFunc: unknown type %T","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"hugolib/content_map_page_contentnodeshifter.go","lineNumber":88,"sourceCode":"\t\treturn false\n\tcase contentNodes:\n\t\tfor i, n := range ss {\n\t\t\tif f(n) {\n\t\t\t\tresource.MarkStale(n)\n\t\t\t\tss = append(ss[:i], ss[i+1:]...)\n\t\t\t}\n\t\t}\n\t\treturn len(ss) == 0\n\tcase contentNodesMap:\n\t\tfor k, n := range ss {\n\t\t\tif f(n) {\n\t\t\t\tresource.MarkStale(n)\n\t\t\t\tdelete(ss, k)\n\t\t\t}\n\t\t}\n\t\treturn len(ss) == 0\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"DeleteFunc: unknown type %T\", v))\n\t}\n}\n\nfunc (s *contentNodeShifter) ForEeachInAllDimensions(n contentNode, f func(contentNode) bool) {\n\tif n == nil {\n\t\treturn\n\t}\n\tif v, ok := n.(interface {\n\t\t// Implemented by all the list nodes.\n\t\tForEeachInAllDimensions(f func(contentNode) bool)\n\t}); ok {\n\t\tv.ForEeachInAllDimensions(f)\n\t\treturn\n\t}\n\tf(n)\n}\n\nfunc (s *contentNodeShifter) ForEeachInDimension(n contentNode, vec sitesmatrix.Vector, d int, f func(contentNode) bool) {","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/content_map_page_contentnodeshifter.go#L70-L106","documentation":"An internal panic in contentNodeShifter.DeleteFunc (hugolib/content_map_page_contentnodeshifter.go:88). The shifter's DeleteFunc handles contentNodeSingle, contentNodes, and contentNodesMap; the default branch panics naming the unrecognized type, enforcing the shifter contract for the doctree.","triggerScenarios":"Passing a contentNode of an unregistered type into the shifter's DeleteFunc — an internal contract violation, not reachable via user content.","commonSituations":"Hugo internal bug or a custom shifter/node extension; not triggered by normal builds.","solutions":["Report a Hugo bug","Ensure all contentNode types placed in the tree are one of the handled categories","Upgrade Hugo"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// Internal: type-switch before calling DeleteFunc-equivalent logic.\nswitch v.(type) {\ncase contentNodeSingle, contentNodes, contentNodesMap:\ndefault:\n    return false // or handle gracefully\n}","typeGuard":"func isShiftableForDelete(v contentNode) bool {\n    switch v.(type) {\n    case contentNodeSingle, contentNodes, contentNodesMap:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Only place recognized node types in the shiftable tree","Extend the shifter when introducing new node types","Report Hugo bugs; this is an internal contract"],"tags":["hugolib","doctree","shifter","internal","panic"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}