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

  1. Report a Hugo bug with reproduction steps
  2. Ensure VectorSample is only called after confirming LenVectors() > 0
  3. 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

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


AI-assisted analysis of gohugoio/hugo@52c9bd7908 (2026-08-09). Data as JSON: /api/errors/266b7704ee2bb44c. Report an issue: GitHub.