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

Issue running the example site: can't evaluate field IsServer in type interface #149

Closed
bronwynbiro opened this issue Mar 1, 2024 · 4 comments

Comments

@bronwynbiro
Copy link

When I run hugo serve --themesDir ../.. to try to run the example site, I get the following:

Start building sites … 
hugo v0.111.3+extended linux/arm64 BuildDate=2023-03-16T08:41:31Z VendorInfo=debian:0.111.3-1
ERROR 2024/03/02 08:40:03 render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
ERROR 2024/03/02 08:40:03 render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
ERROR 2024/03/02 08:40:03 render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
ERROR 2024/03/02 08:40:03 render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
Error: Error building site: failed to render pages: render of "page" failed: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/_default/baseof.html:3:6": execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html:21:9": execute of template failed: template: partials/head.html:21:9: executing "partials/head.html" at <hugo>: can't evaluate field IsServer in type interface {}
Built in 140 ms

Has anyone dealt with this/know how to fix it?

@henrykoothur
Copy link

hi,
you could try to remove lines starting from 21 till 30 in the /home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html. it worked for me.

@nmin11
Copy link

nmin11 commented Mar 16, 2024

I solved it by reverting the 21 line of themes/blist/layouts/partials/head.html among the changes in PR #148

{{- if .Site.IsServer }}

But this seems like abnormal way.
We need error fix or guidance for update.

@doc-E-brown
Copy link

hi, you could try to remove lines starting from 21 till 30 in the /home/bronwynbiro/hugo-blog/themes/blist/layouts/partials/head.html. it worked for me.

This solved the problem for me

@soerenetler
Copy link

For me this was an issue with the hugo version. you need at least v0.120.0 for the isServer flag to be set. On ubuntu the apt-repository version is way too old.

https://gohugo.io/functions/hugo/isserver/

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

5 participants