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

Fails to run with "can't evaluate field Site in type *page.siteWrapper" on Hugo v0.119.0 #662

Closed
fedragon opened this issue Sep 29, 2023 · 5 comments
Labels
non-issue Nothing needs to be fixed

Comments

@fedragon
Copy link

Issue description

Hello,

First of all, thank you for this amazing theme, I've been using it for a while and I'm very happy with it! This morning I upgraded Hugo to its latest version (v0.119.0) and then ran hugo serve, and I got this error:

Start building sites … 
hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended darwin/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=brew

ERROR render of "page" failed: "/Users/freidereikhs/Private/shiny-blog/_vendor/github.com/jpanther/congo/v2/layouts/_default/baseof.html:1:4": execute of template failed: template: _default/single.html:1:4: executing "_default/single.html" at <partial "partials/functions/warnings.html" .Site>: error calling partial: "/Users/freidereikhs/Private/shiny-blog/_vendor/github.com/jpanther/congo/v2/layouts/partials/functions/warnings.html:1:14": execute of template failed: template: partials/functions/warnings.html:1:14: executing "partials/functions/warnings.html" at <.Site.Params.showAppearanceSwitcher>: can't evaluate field Site in type *page.siteWrapper

I replaced both occurrences of .Site with site in partials/functions/warnings.html (as mentioned here) and that solved the issue.

Cheers!

Theme version

v2.6.1

Hugo version

hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended darwin/amd64

Which browser rendering engines are you seeing the problem on?

No response

URL to sample repository or website

No response

Hugo output or build error messages

Start building sites … 
hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e+extended darwin/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=brew

ERROR render of "page" failed: "/Users/freidereikhs/Private/shiny-blog/_vendor/github.com/jpanther/congo/v2/layouts/_default/baseof.html:1:4": execute of template failed: template: _default/single.html:1:4: executing "_default/single.html" at <partial "partials/functions/warnings.html" .Site>: error calling partial: "/Users/freidereikhs/Private/shiny-blog/_vendor/github.com/jpanther/congo/v2/layouts/partials/functions/warnings.html:1:14": execute of template failed: template: partials/functions/warnings.html:1:14: executing "partials/functions/warnings.html" at <.Site.Params.showAppearanceSwitcher>: can't evaluate field Site in type *page.siteWrapper
@fedragon fedragon added the bug Something isn't working label Sep 29, 2023
@fedragon fedragon changed the title Running Hugo v0.119.0 fails with can't evaluate field Site in type *page.siteWrapper Hugo v0.119.0 fails to run with "can't evaluate field Site in type *page.siteWrapper" Sep 29, 2023
@fedragon fedragon changed the title Hugo v0.119.0 fails to run with "can't evaluate field Site in type *page.siteWrapper" Fails to run with "can't evaluate field Site in type *page.siteWrapper" on Hugo v0.119.0 Sep 29, 2023
@jpanther
Copy link
Owner

I'm not able to replicate this issue and those site variables are not in the code you're referring to in the stable branch. Are you sure you're running the latest version of the theme?

@wolfspyre
Copy link
Contributor

I’m running into something similar with moving some of my other code to work with congo… I think it has to do with my overuse of $.Scratch and the way context is passed around… might be helpful in your own spelunking, or might just be me :)

@jpanther
Copy link
Owner

I think these may be separate issues. My suspicion about the version of the theme in my comment above relates to the fact that @fedragon's website is currently running v2.3.1 and so that is potentially the source of the problem.

One of the main issues I've had with Hugo's modules is that it is not very good at cleaning up the local cache when updating modules. The hugo mod clean command should be your first port of call whenever you come across an obscure error as this will clear out the local cache and force a download of the latest version of the modules.

@wolfspyre
Copy link
Contributor

Yeah... I didn't think it likely to be the same root cause; but wanted to at least provide some sympathetic commiseration.

Obscure PC LOAD LETTER-esque errors suck ;)

YOUR input is far more useful to the reporter here ;)

@fedragon
Copy link
Author

Hi @jpanther you are absolutely right. I just ran hugo mod clean and that solved the issue 🤦 Thank you!

@jpanther jpanther added non-issue Nothing needs to be fixed and removed bug Something isn't working labels Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-issue Nothing needs to be fixed
Projects
None yet
Development

No branches or pull requests

3 participants