I open this issue here as told by @jmooring on GitHub.
Hugo Static Site Generator v0.72.0/extended windows/amd64 BuildDate: unknown
Does this issue reproduce with the latest release?
Yes
Since many versions (sorry I did not keep track), I have this error “randomly” popping (in all my Hugo projects I think), when sometimes I do not change anything (it happens in the watcher apparently), but usually when I change a file. Then the process stops, I launch back hugo and the error is not here any more. I would say it happens around every half an hour or so, to give an idea. For example it happens in this repo.
log:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xfd042d]
goroutine 251 [running]:
github.com/gohugoio/hugo/hugolib.(*pageMaps).withMaps(0x0, 0xc003cb0240, 0x3, 0xc0035ad4f7)
/root/project/hugo/hugolib/content_map_page.go:781 +0x2d
github.com/gohugoio/hugo/hugolib.(*HugoSites).removePageByFilename(0xc005e8c6e0, 0xc0035ad490, 0x6a)
/root/project/hugo/hugolib/hugo_sites.go:709 +0x75
github.com/gohugoio/hugo/hugolib.(*Site).processPartial(0xc0042658c0, 0xc003caa640, 0xc001a71740, 0xc003cb0120, 0x1, 0x1, 0x0, 0x0)
/root/project/hugo/hugolib/site.go:1085 +0xa10
github.com/gohugoio/hugo/hugolib.(*HugoSites).process(0xc005e8c6e0, 0xc003caa640, 0xc001a71740, 0xc0038bb5a0, 0x1, 0x1, 0x315ffd8, 0x30001)
/root/project/hugo/hugolib/hugo_sites_build.go:244 +0xa0
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func2.2()
/root/project/hugo/hugolib/hugo_sites_build.go:118 +0x6b
runtime/trace.WithRegion(0x2429c20, 0xc003ca9980, 0x1e8c153, 0x7, 0xc001a71768)
/usr/local/go/src/runtime/trace/annotation.go:137 +0x105
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func2(0x315ffd8, 0xc003c91501)
/root/project/hugo/hugolib/hugo_sites_build.go:120 +0x169
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func3()
/root/project/hugo/hugolib/hugo_sites_build.go:137 +0x36
runtime/trace.WithRegion(0x2429c20, 0xc003ca9980, 0x1e8c0e3, 0x7, 0xc001a71910)
/usr/local/go/src/runtime/trace/annotation.go:137 +0x105
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build(0xc005e8c6e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0038c0150, 0x0, 0xc0038bb5a0, ...)
/root/project/hugo/hugolib/hugo_sites_build.go:139 +0x966
github.com/gohugoio/hugo/commands.(*commandeer).rebuildSites(0xc0007f9860, 0xc0038bb5a0, 0x1, 0x1, 0x0, 0x0)
/root/project/hugo/commands/hugo.go:734 +0x40e
github.com/gohugoio/hugo/commands.(*commandeer).handleEvents(0xc0007f9860, 0xc002d0cb00, 0xc0024b85f8, 0xc002d70260, 0x1, 0x1, 0xc0022dc690)
/root/project/hugo/commands/hugo.go:1099 +0x76b
github.com/gohugoio/hugo/commands.(*commandeer).newWatcher.func1(0xc002d0cb00, 0xc0007f9860, 0xc0024b85f8, 0xc0022dc690)
/root/project/hugo/commands/hugo.go:841 +0x1df
created by github.com/gohugoio/hugo/commands.(*commandeer).newWatcher
/root/project/hugo/commands/hugo.go:837 +0x294