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 · 4 comments
Closed

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

regisphilibert opened this issue Jul 29, 2021 · 4 comments
Labels
Milestone

Comments

@regisphilibert
Copy link
Member

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 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 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 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.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants