Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error calling Menus: cannot convert <nil> to maps.Params #8825

Closed
regisphilibert opened this issue Jul 29, 2021 · 3 comments
Closed

error calling Menus: cannot convert <nil> to maps.Params #8825

regisphilibert opened this issue Jul 29, 2021 · 3 comments
Milestone

Comments

@regisphilibert
Copy link
Member

@regisphilibert regisphilibert commented Jul 29, 2021

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

hugo v0.86.0-41C6C52E+extended darwin/amd64 BuildDate=2021-07-21T09:53:14Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

Yes but not on 85.0, might have something to do with cascade in config.

I'm leaving this here, if this message does not speak by itself, I'll try and share more and reproduce the error on a simple project (it's currently happening on a rather complex one).

A simple {{ with site.Menus }} is currently triggering this.

bep added a commit to bep/hugo that referenced this issue Jul 30, 2021
@bep
Copy link
Member

@bep bep commented Jul 30, 2021

I have added #8830 which should remove the error, but even if I think that solution is sound enough (treat nil Params as empty Params), I'm curious as to why ...

This is a config.toml (?) with a menu item with params?

@regisphilibert
Copy link
Member Author

@regisphilibert regisphilibert commented Jul 30, 2021

Actually I found the culprit... I had left something like this in one of the content files (an empty params key on a menus map):

titlte: ...
menus:
  main: 
    parent: journal
    weight: 2
    params:

It did not break under 85 hence me not noticing...

@bep
Copy link
Member

@bep bep commented Jul 30, 2021

I suspected the above, so I tried to create a failing test for it ... In TOML, but ah, YAML decodes empty maps to nil. How liberating.

bep added a commit to bep/hugo that referenced this issue Jul 30, 2021
@bep bep added this to the v0.88 milestone Jul 30, 2021
@bep bep closed this in e3dc524 Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants