When upgrading from Hugo v0.147.5 to v0.147.6 I get the following error when trying to run hugo server
:
panic: assignment to entry in nil map
goroutine 162 [running]:
github.com/gohugoio/hugo/hugolib.(*pageState).setMetaPost.func1(...)
/root/project/hugo/hugolib/page__meta.go:319
github.com/gohugoio/hugo/common/maps.(*Ordered[...]).Range(...)
/root/project/hugo/common/maps/ordered.go:132
github.com/gohugoio/hugo/hugolib.(*pageState).setMetaPost(0xc000136930, 0xc000492580)
/root/project/hugo/hugolib/page__meta.go:306 +0x14ba
github.com/gohugoio/hugo/hugolib.(*sitePagesAssembler).applyAggregates.func1({0xc00080ab00, 0x15}, {0x102046b60, 0xc000136930}, 0x30?)
/root/project/hugo/hugolib/content_map_page.go:1448 +0x445
github.com/gohugoio/hugo/hugolib/doctree.(*NodeShiftTreeWalker[...]).Walk.func1({0x101b0d660, 0xc000136930})
/root/project/hugo/hugolib/doctree/nodeshifttree.go:377 +0xf7
github.com/armon/go-radix.recursiveWalk(0xc0006c9170, 0xc000987df0)
/root/project/gomodcache/github.com/armon/go-radix@v1.0.1-0.20221118154546-54df44f2176c/radix.go:523 +0x43
github.com/armon/go-radix.recursiveWalk(0xc0006ef020, 0xc000987df0)
/root/project/gomodcache/github.com/armon/go-radix@v1.0.1-0.20221118154546-54df44f2176c/radix.go:532 +0x93
github.com/armon/go-radix.recursiveWalk(0xc0006ff6b0, 0xc000987df0)
/root/project/gomodcache/github.com/armon/go-radix@v1.0.1-0.20221118154546-54df44f2176c/radix.go:532 +0x93
github.com/armon/go-radix.recursiveWalk(0xc00034bb60, 0xc000987df0)
/root/project/gomodcache/github.com/armon/go-radix@v1.0.1-0.20221118154546-54df44f2176c/radix.go:532 +0x93
github.com/armon/go-radix.(*Tree).Walk(...)
/root/project/gomodcache/github.com/armon/go-radix@v1.0.1-0.20221118154546-54df44f2176c/radix.go:453
github.com/gohugoio/hugo/hugolib/doctree.(*NodeShiftTreeWalker[...]).Walk(0x10204eda0?, {0x0?, 0x0?})
/root/project/hugo/hugolib/doctree/nodeshifttree.go:387 +0x105
github.com/gohugoio/hugo/hugolib.(*sitePagesAssembler).applyAggregates(0xc0004922e0)
/root/project/hugo/hugolib/content_map_page.go:1525 +0x23d
github.com/gohugoio/hugo/hugolib.(*sitePagesAssembler).assemblePagesStep1(0xc0004922e0, {0x1000000000001?, 0xc000136a80?})
/root/project/hugo/hugolib/content_map_page.go:1869 +0x45
github.com/gohugoio/hugo/hugolib.(*HugoSites).assemble.func1()
/root/project/hugo/hugolib/hugo_sites_build.go:304 +0x1f
github.com/gohugoio/hugo/common/para.(*errGroupRunner).Run.func1()
/root/project/hugo/common/para/para.go:52 +0x22
golang.org/x/sync/errgroup.(*Group).Go.func1()
/root/project/gomodcache/golang.org/x/sync@v0.13.0/errgroup/errgroup.go:79 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 15
/root/project/gomodcache/golang.org/x/sync@v0.13.0/errgroup/errgroup.go:76 +0x93
I tracked the issue down to a section of my site with this (simplified) content structure:
content/
└── section-a/
├── _index.md
├── page-1.md
└── section-b/
├── _index.md
├── page-2.md
└── page-3.md
The frontmatter in section-a/_index.md
cascades outputs
:
cascade:
outputs:
- RSS
And the frontmatter in section-a/section-b/_index.md
cascades params
:
cascade:
params:
foo: bar
The error is caused because outputs
is not present in the cascade
object in section-a/section-b/_index.md
.
Repeating the parameter fixes the error. Is this a bug, or was it incorrect to use nested cascade
objects?
Here’s a repo demonstrating the error: GitHub - squidfingers/hugo-cascade-panic