I just updated my Go (1.18.2) and Hugo (0.99) and now I get this error when trying to build my site locally (hugo server
):
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
github.com/gohugoio/hugo/commands.(*serverCmd).server.func1(0xc0002f6870)
github.com/gohugoio/hugo/commands/server.go:222 +0x6e5
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig(0xc0002f6870)
github.com/gohugoio/hugo/commands/commandeer.go:390 +0x702
github.com/gohugoio/hugo/commands.newCommandeer(0x1, 0x1, 0x1, 0xc0002f6690, {0x642d8a0?, 0xc00038f580}, 0xc000131b40, {0x0, 0x0, 0x0})
github.com/gohugoio/hugo/commands/commandeer.go:226 +0x310
github.com/gohugoio/hugo/commands.initializeConfig(0x0?, 0x0?, 0x0?, 0x5eb48c7?, {0x642d8a0?, 0xc00038f580?}, 0x1d0?)
github.com/gohugoio/hugo/commands/hugo.go:125 +0x31
github.com/gohugoio/hugo/commands.(*serverCmd).server(0xc00038f580, 0xc000627680, {0xc000254500?, 0x4592e40?, 0xc00077fd00?})
github.com/gohugoio/hugo/commands/server.go:249 +0x1cd
github.com/gohugoio/hugo/commands.(*commandsBuilder).newServerCmdSignaled.func1(0xc000627680?, {0x7561268?, 0x0?, 0x0?})
github.com/gohugoio/hugo/commands/server.go:96 +0x36
github.com/spf13/cobra.(*Command).execute(0xc000627680, {0x7561268, 0x0, 0x0})
github.com/spf13/cobra@v1.4.0/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000787400)
github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/gohugoio/hugo/commands.Execute({0xc000130010, 0x1, 0x1})
github.com/gohugoio/hugo/commands/hugo.go:92 +0xb4
main.main()
github.com/gohugoio/hugo/main.go:23 +0x57
The funny thing is that Netlify builds my site correctly using the same versions of Go and Hugo.
Could you try to clone my repo and run hugo server
to see if you can reproduce it? The site built correctly (both locally and in Netlify) using Go 1.18.1 and Hugo 0.98.
Thank you very much in advance!
Rodrigo