{"record":{"id":"266b7704ee2bb44c","repo":"gohugoio/hugo","slug":"no-vectors","errorCode":null,"errorMessage":"no vectors","messagePattern":"no vectors","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"hugolib/content_map_page_contentnode.go","lineNumber":473,"sourceCode":"\nfunc (n contentNodesMap) ForEachVector(yield func(v sitesmatrix.Vector) bool) bool {\n\tfor v := range n {\n\t\tif !yield(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (n contentNodesMap) LenVectors() int {\n\treturn len(n)\n}\n\nfunc (n contentNodesMap) VectorSample() sitesmatrix.Vector {\n\tfor v := range n {\n\t\treturn v\n\t}\n\tpanic(\"no vectors\")\n}\n","sourceCodeStart":455,"sourceCodeEnd":475,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/content_map_page_contentnode.go#L455-L475","documentation":"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.","triggerScenarios":"VectorSample is invoked on a contentNodesMap that is empty — an internal caller-protocol violation during content-map manipulation or a rebuild.","commonSituations":"Hugo internal logic error during partial rebuilds or content map setup; not triggered by normal user content.","solutions":["Report a Hugo bug with reproduction steps","Ensure VectorSample is only called after confirming LenVectors() > 0","Upgrade Hugo; this is an internal assertion"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if m.LenVectors() == 0 {\n    return errors.New(\"cannot sample vector from empty contentNodesMap\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check LenVectors() > 0 before calling VectorSample","Treat empty maps as a programming error in internal callers","Report Hugo bugs that surface this panic"],"tags":["hugolib","content-map","internal","panic"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}