gohugoio/hugo · critical
no vectors
Error message
no vectors
What it means
An internal panic in contentNodesMap.VectorSample (hugolib/content_map_page_contentnode.go:473) when the map has no entries, so there is no vector to sample. Callers must guarantee the map is non-empty before sampling.
Source
Thrown at hugolib/content_map_page_contentnode.go:473
func (n contentNodesMap) ForEachVector(yield func(v sitesmatrix.Vector) bool) bool {
for v := range n {
if !yield(v) {
return false
}
}
return true
}
func (n contentNodesMap) LenVectors() int {
return len(n)
}
func (n contentNodesMap) VectorSample() sitesmatrix.Vector {
for v := range n {
return v
}
panic("no vectors")
}
View on GitHub (pinned to 52c9bd7908)
Solutions
- Report a Hugo bug with reproduction steps
- Ensure VectorSample is only called after confirming LenVectors() > 0
- Upgrade Hugo; this is an internal assertion
Defensive patterns
Strategy: validation
Validate before calling
if m.LenVectors() == 0 {
return errors.New("cannot sample vector from empty contentNodesMap")
} Prevention
- Check LenVectors() > 0 before calling VectorSample
- Treat empty maps as a programming error in internal callers
- Report Hugo bugs that surface this panic
When it happens
Trigger: VectorSample is invoked on a contentNodesMap that is empty — an internal caller-protocol violation during content-map manipulation or a rebuild.
Common situations: Hugo internal logic error during partial rebuilds or content map setup; not triggered by normal user content.
Related errors
- contentNodeToContentNodesPage: unexpected type %T
- DeleteFunc: unknown type %T
- Insert: unknown type %T
- Shift: unknown type %T for %q
- no site found for matrix %s
AI-assisted analysis of gohugoio/hugo@52c9bd7908 (2026-08-09).
Data as JSON: /api/errors/266b7704ee2bb44c.
Report an issue: GitHub.