Can't access .Site.Menus from index template?

I am trying to access .Site.Menus from inside my site’s index.html template and it is failing, looking like an empty array, despite there being a lot of menu items defined in front matter of various pages. I can access .Site.Menus just fine from my header.html partial when building the site’s main menu. Trying to access site.Menus works no better from index.html.

Weirdly, I can access .Site.Params from my index.html template no problem, just not .Site.Menus. So for the code below from index.html, the first line shows nothing while the second shows a bunch of values:

<h4>site.Menus = {{ delimit site.Menus ", " }}</h4>
<h4>site.Params = {{ delimit site.Params ", " }}</h4>

Put these two lines in my header.html partial, and they both show values.

What’s going on? How do I access .Site.Menus from my index.html template? I am on 0.84 - is this a config merge-related issue?

Just in case you are working with the latest Hugo version then know that site.Menus might be “nil” due to a bug. Downgrade to 0.83.1 or wait for 0.84.1 to come out to fix it.