Error building Hugo site on Netlify

Hi,

I am getting the error below when my site is being built in Netlify. The site runs and builds fine locally (Windows).

In case it helps the source code is here: https://github.com/NRKirby/AzureCollected-Web

8:26:19 PM: ERROR 2020/06/01 19:26:19 render of "taxonomyTerm" failed: "/opt/build/repo/layouts/_default/baseof.html:171:27": execute of template failed: template: _default/terms.html:171:27: executing "header" at <partial "site-header...>: error calling partial: "/opt/build/repo/layouts/partials/site-header.html:1:1": execute of template failed: panic in Execute: runtime error: invalid memory address or nil pointer dereference. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this.

8:26:19 PM: Total in 43 ms

8:26:19 PM: Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: "/opt/build/repo/layouts/_default/baseof.html:171:27": execute of template failed: template: _default/terms.html:171:27: executing "header" at <partial "site-header...>: error calling partial: "/opt/build/repo/layouts/partials/site-header.html:1:1": execute of template failed: panic in Execute: runtime error: invalid memory address or nil pointer dereference. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this.

can anyone help with this? I’m at a loss why this is happening…

Nick

I notice that Netlify is building using a lower version than I am locally.

In Netlify:

7:05:39 AM: $ hugo version && hugo

7:05:39 AM: Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z

I have tried changing the version in config.toml with the latest version but Netlify keeps building with the earlier version:

[context.production.environment]

  HUGO_VERSION = "0.72"

Does anyone know why?

Ok I fixed this by setting the HUGO_VERSION as an environment variable in Netlify, I don’t know why it wasn’t working in config.toml…

For the next time: there is a netlify.toml for all configuration parameters on Netlify.

1 Like