gohugoio/hugo · critical
DeleteFunc: unknown type %T
Error message
DeleteFunc: unknown type %T
What it means
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.
Source
Thrown at hugolib/content_map_page_contentnodeshifter.go:88
return false
case contentNodes:
for i, n := range ss {
if f(n) {
resource.MarkStale(n)
ss = append(ss[:i], ss[i+1:]...)
}
}
return len(ss) == 0
case contentNodesMap:
for k, n := range ss {
if f(n) {
resource.MarkStale(n)
delete(ss, k)
}
}
return len(ss) == 0
default:
panic(fmt.Sprintf("DeleteFunc: unknown type %T", v))
}
}
func (s *contentNodeShifter) ForEeachInAllDimensions(n contentNode, f func(contentNode) bool) {
if n == nil {
return
}
if v, ok := n.(interface {
// Implemented by all the list nodes.
ForEeachInAllDimensions(f func(contentNode) bool)
}); ok {
v.ForEeachInAllDimensions(f)
return
}
f(n)
}
func (s *contentNodeShifter) ForEeachInDimension(n contentNode, vec sitesmatrix.Vector, d int, f func(contentNode) bool) {View on GitHub (pinned to 52c9bd7908)
Solutions
- Report a Hugo bug
- Ensure all contentNode types placed in the tree are one of the handled categories
- Upgrade Hugo
Defensive patterns
Strategy: type-guard
Validate before calling
// Internal: type-switch before calling DeleteFunc-equivalent logic.
switch v.(type) {
case contentNodeSingle, contentNodes, contentNodesMap:
default:
return false // or handle gracefully
} Type guard
func isShiftableForDelete(v contentNode) bool {
switch v.(type) {
case contentNodeSingle, contentNodes, contentNodesMap:
return true
}
return false
} Prevention
- 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
When it happens
Trigger: Passing a contentNode of an unregistered type into the shifter's DeleteFunc — an internal contract violation, not reachable via user content.
Common situations: Hugo internal bug or a custom shifter/node extension; not triggered by normal builds.
Related errors
- Insert: unknown type %T
- Shift: unknown type %T for %q
- contentNodeToContentNodesPage: unexpected type %T
- no vectors
- no site found for matrix %s
AI-assisted analysis of gohugoio/hugo@52c9bd7908 (2026-08-09).
Data as JSON: /api/errors/053d460567961349.
Report an issue: GitHub.