question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hugo: Error building site: failed to render pages

See original GitHub issue

Is this a BUG REPORT or FEATURE REQUEST?: bug

What happened: On my way to produce a minimal example for issue #759 , I encountered this problem:

I prepared the config.toml file to support a secondary language. I did not translate anything except the title in the config file.

I get this error (see also below):

render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:10:7: executing "_default/list.html"  ...

What you expected to happen: Hugo should generate the static site without errors.

How to reproduce it (as minimally and precisely as possible): see code block below and specifically this commit introducing the error: https://github.com/schoettl/syna-start/commit/af02744f612184500b8848a548b534ea02f93a2e

Anything else we need to know?: I did not understand the error message and I could not find solutions on the web.

Environment:

  • Syna Theme version: current from syna-start (2020-05-20)
  • Hugo version: 0.71.0
  • OS: Arch
$ git clone --recurse-submodules https://github.com/schoettl/syna-start.git
$ git checkout bug-1
$ hugo
Building sites … WARN 2020/05/20 23:10:03 .File.Dir on zero object. Wrap it in if or with: {{ with .File }}{{ .Dir }}{{ end }}
ERROR 2020/05/20 23:10:03 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:10:7: executing "_default/list.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "/home/jakob/tmp/syna-start/themes/syna/layouts/partials/fragments/hero.html:106:12": execute of template failed: template: partials/fragments/hero.html:106:12: executing "partials/fragments/hero.html" at <.page.File.Dir>: error calling Dir: runtime error: invalid memory address or nil pointer dereference
ERROR 2020/05/20 23:10:03 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:10:7: executing "_default/list.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "/home/jakob/tmp/syna-start/themes/syna/layouts/partials/fragments/hero.html:106:12": execute of template failed: template: partials/fragments/hero.html:106:12: executing "partials/fragments/hero.html" at <.page.File.Dir>: error calling Dir: runtime error: invalid memory address or nil pointer dereference
Total in 517 ms
Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template: _default/list.html:10:7: executing "_default/list.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "/home/jakob/tmp/syna-start/themes/syna/layouts/partials/fragments/hero.html:106:12": execute of template failed: template: partials/fragments/hero.html:106:12: executing "partials/fragments/hero.html" at <.page.File.Dir>: error calling Dir: runtime error: invalid memory address or nil pointer dereference

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
schoettlcommented, Jul 4, 2020

@mpourismaiel Thanks a lot for your work! So for, hugo runs again. I’ll next test the other issue.

BTW, the command to create the _index/index.md file had the -e option missing.

 echo -e "+++\nheadless = true\n+++" > content/_index/index.md # create a headless page to fill the section page
0reactions
mpourismaielcommented, Jul 2, 2020

I pushed a fix and created a PR at https://github.com/okkur/syna-start/pull/36

Let us know if the problem persists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error building site: failed to render pages: render of "home ...
After adding theme, I am getting following error. I have tried with brand new site, without any content, facing the same issue.
Read more >
Error building site: failed to render pages - HUGO
I am working with hugo-universal-theme, and I get the following error when running [hugo server -D]. Error building site: failed to render ......
Read more >
How to Fix "Error: Error building site: failed to render pages
I had this error while minified the blog using the hugo --minify command: The full message for me was: Error: Error building site:...
Read more >
execute of template. Blogdown 1.6, Hugo Aperó 0.89.4, R 4.1 ...
4, I can not render my site locally with blogdown:::serve_site() command and I can not update the site at Netlify. The error I...
Read more >
How to "unbreak" my blogdown website? Problem in the ...
The netlify.toml in themes/hugo-apero has HUGO_VERSION = "0.80.0" in ... Error: Error building site: failed to render pages: render of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found