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

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

Open
federicotravaini opened this issue Sep 23, 2023 · 5 comments

Comments

@federicotravaini
Copy link

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.

@luizdepra
Copy link
Owner

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?

@federicotravaini
Copy link
Author

federicotravaini commented Sep 25, 2023

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

@federicotravaini
Copy link
Author

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 % 

@luizdepra
Copy link
Owner

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.

@matsest
Copy link

matsest commented Oct 13, 2024

This works fine as long as

[taxonomies]
category = 'categories' # default taxonomy
tag = 'tags' # default taxonomy
series = "series"

is defined in the config file (tested with hugo v0.135)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants