gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.73k stars 7.53k forks source link

A site with a menu cannot import a module with a menu #9488

Closed rvodden closed 2 years ago

rvodden commented 2 years ago

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.92.1+extended darwin/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

yes

If a site tries to pull in a module which has a menu in its configuration then hugo panics.

I have created a minimal example in these two repos:

https://github.com/rvodden/hugo-main-site https://github.com/rvodden/hugo-sub-site

running hugo serve gives us:

panic: interface conversion: interface {} is []interface {}, not maps.Params

goroutine 1 [running]:
github.com/gohugoio/hugo/config.(*defaultConfigProvider).Merge(0xc00010f810, {0x0, 0x0}, {0x5bb9060, 0xc000496ab0})
        github.com/gohugoio/hugo/config/defaultConfigProvider.go:227 +0xbf4
github.com/gohugoio/hugo/hugolib.configLoader.collectModules.func1(0xc00003d9c0)
        github.com/gohugoio/hugo/hugolib/config.go:393 +0x222
github.com/gohugoio/hugo/modules.(*Client).Collect(0xc000964a00)
        github.com/gohugoio/hugo/modules/collect.go:79 +0x1c4
github.com/gohugoio/hugo/hugolib.configLoader.collectModules({{0x617aeb0, 0xc00010f810}, {{0x6179820, 0x711d340}, {0x617f7f0, 0xc000437d70}, {0x0, 0x0}, {0xc0000460a4, 0x46}, ...}}, ...)
        github.com/gohugoio/hugo/hugolib/config.go:420 +0x510
github.com/gohugoio/hugo/hugolib.LoadConfig({{0x6179820, 0x711d340}, {0x617f7f0, 0xc000437d70}, {0x0, 0x0}, {0xc0000460a4, 0x46}, {0xc0000460a4, 0x46}, ...}, ...)
        github.com/gohugoio/hugo/hugolib/config.go:148 +0xbbe
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig(0xc000145500)
        github.com/gohugoio/hugo/commands/commandeer.go:309 +0x365
github.com/gohugoio/hugo/commands.newCommandeer(0x0, 0x0, 0x0, 0xc000145340, {0x612a160, 0xc000198b40}, 0x0, {0x0, 0x0, 0x0})
        github.com/gohugoio/hugo/commands/commandeer.go:193 +0x310
github.com/gohugoio/hugo/commands.initializeConfig(0xc4, 0x2a, 0xc7, 0xc000703860, {0x612a160, 0xc000198b40}, 0x415abd3)
        github.com/gohugoio/hugo/commands/hugo.go:125 +0x31
github.com/gohugoio/hugo/commands.(*modCmd).initConfig(0x5c6d65c, 0x4)
        github.com/gohugoio/hugo/commands/mod.go:288 +0x37
github.com/gohugoio/hugo/commands.(*modCmd).withModsClient(0xc00095be00, 0x7d, 0xc0008ffce0)
        github.com/gohugoio/hugo/commands/mod.go:270 +0x1e
github.com/gohugoio/hugo/commands.(*commandsBuilder).newModCmd.func1(0x1, {0xc00043cef0, 0x0, 0x7ffeefbfef1d})
        github.com/gohugoio/hugo/commands/mod.go:200 +0x1e5
github.com/spf13/cobra.(*Command).execute(0xc000954780, {0xc00043cef0, 0x1, 0x1})
        github.com/spf13/cobra@v1.2.1/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xc000955400)
        github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc
github.com/gohugoio/hugo/commands.Execute({0xc0001aa010, 0x3, 0x3})
        github.com/gohugoio/hugo/commands/hugo.go:92 +0xb4
main.main()
        github.com/gohugoio/hugo/main.go:23 +0x58
github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.