luizdepra / hugo-coder

A minimalist blog theme for hugo.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

series.html: error calling len: reflect: call of reflect.Value.Type on zero Value

federicotravaini opened this issue · comments

I am trying to deploy the examplewebsite with githubg and cloudflare: https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/

I encounter this error

ERROR render of "page" failed: "/opt/buildhome/repo/themes/hugo-coder/layouts/posts/single.html:43:11": execute of template failed: template: posts/single.html:43:11: executing "content" at <partial "posts/series.html" .>: error calling partial: "/opt/buildhome/repo/themes/hugo-coder/layouts/partials/posts/series.html:7:14": execute of template failed: template: partials/posts/series.html:7:14: executing "partials/posts/series.html" at <len $series.Pages>: error calling len: reflect: call of reflect.Value.Type on zero Value

How can I fix it?

PS: If I run the site on local mac it works just fine.

Hey!

It looks like something related with a series configuration. Did you change something in the example content?
Which version of Hugo are you using?

I don't think so, but I am no expert so I made the repo public (just for debug): https://github.com/federicotravaini/federico-travaini-xyz-website

Can you have a look into it?

PS If i run it locally I have no errors

Ok I was running Hugo 0.115 locally and the ExampleSite works
Cloudflare is running Hugo 0.118 and I get the errore
Now I've upgraded Hugo locally to the latest version (0.119) and I get the same error

ERROR render of "page" failed: "/Users/federicotravaini/Documents/GitHub/federico-travaini-xyz/themes/hugo-coder/layouts/posts/single.html:43:11": execute of template failed: template: posts/single.html:43:11: executing "content" at <partial "posts/series.html" .>: error calling partial: "/Users/federicotravaini/Documents/GitHub/federico-travaini-xyz/themes/hugo-coder/layouts/partials/posts/series.html:7:14": execute of template failed: template: partials/posts/series.html:7:14: executing "partials/posts/series.html" at <len $series.Pages>: error calling len: reflect: call of reflect.Value.Type on zero Value
Built in 72 ms
Error: error building site: render: failed to render pages: render of "page" failed: "/Users/federicotravaini/Documents/GitHub/federico-travaini-xyz/themes/hugo-coder/layouts/posts/single.html:43:11": execute of template failed: template: posts/single.html:43:11: executing "content" at <partial "posts/series.html" .>: error calling partial: "/Users/federicotravaini/Documents/GitHub/federico-travaini-xyz/themes/hugo-coder/layouts/partials/posts/series.html:7:14": execute of template failed: template: partials/posts/series.html:7:14: executing "partials/posts/series.html" at <len $series.Pages>: error calling len: reflect: call of reflect.Value.Type on zero Value
federicotravaini@MacBook-Pro-di-Federico federico-travaini-xyz % 

Right. So, it is Hugo breaking things. xD

For now, you could pin the working version. I'll try to fix it later and tell here.