blist-hugo-theme icon indicating copy to clipboard operation
blist-hugo-theme copied to clipboard

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

Open bronwynbiro opened this issue 1 year ago • 4 comments

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?

bronwynbiro avatar Mar 01 '24 19:03 bronwynbiro

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.

henrykoothur avatar Mar 13 '24 10:03 henrykoothur

I solved it by reverting the 21 line of themes/blist/layouts/partials/head.html among the changes in PR https://github.com/apvarun/blist-hugo-theme/pull/148

{{- if .Site.IsServer }}

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

nmin11 avatar Mar 16 '24 02:03 nmin11

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

doc-E-brown avatar May 21 '24 09:05 doc-E-brown

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/

soerenetler avatar Jun 26 '24 17:06 soerenetler