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

theme: guard access to page.File.Filename #1005

Closed
retorquere opened this issue Jan 30, 2025 · 7 comments
Closed

theme: guard access to page.File.Filename #1005

retorquere opened this issue Jan 30, 2025 · 7 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@retorquere
Copy link

I'm trying to build my site, but as of just now I'm getting

"/Users/emile/github/better-bibtex/site/themes/relearn/layouts/_default/list.html:8:5": execute of template failed: template: _default/list.html:8:5: executing "menu" at <.Render>: error calling Render: "/Users/emile/github/better-bibtex/site/content/citing/_index.md:1:1": failed to execute template _default/views/menu.html: "/Users/emile/github/better-bibtex/site/themes/relearn/layouts/_default/views/menu.html:1:4": execute of template failed: template: _default/views/menu.html:1:4: executing "_default/views/menu.html" at <partial "menu.html" .>: error calling partial: "/Users/emile/github/better-bibtex/site/themes/relearn/layouts/partials/menu.html:32:16": execute of template failed: template: partials/menu.html:32:16: executing "partials/menu.html" at <partial "partials/inline/menu-tree" (dict "currentnode" $currentNode "config" $config "showvisitedlinks" $showvisitedlinks)>: error calling partial: execute of template failed: template: partials/menu.html:271:12: executing "partials/inline/menu-tree" at <partialCached "partials/inline/menu-walker" (dict "menu" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks "alwaysopen" $defaultAlwaysopen "isSelf" $isSubSelf "isAncestor" $isSubAncestor "isHidden" $isSubHidden "root" $root) $id>: error calling partialCached: execute of template failed: template: partials/menu.html:305:16: executing "partials/inline/menu-walker" at <partial "menupermalink.gotmpl" (dict "page" $currentNode "menu" .)>: error calling partial: "/Users/emile/github/better-bibtex/site/themes/relearn/layouts/partials/menupermalink.gotmpl:18:126": execute of template failed: template: partials/menupermalink.gotmpl:18:126: executing "partials/menupermalink.gotmpl" at <$.page.File.Filename>: error calling Filename:
 runtime error: invalid memory address or nil pointer dereference
@McShelby
Copy link
Owner

I have an idea about what's going on here. Do you create pages that are not backed by a file?

@retorquere
Copy link
Author

It's all just files on disk, do you mean pages could load things over the network during the build or some such? That's not in play here.

@McShelby
Copy link
Owner

What Hugo version are you using and could you share your repo?

@retorquere
Copy link
Author

Ah upgrading from v0.141 -> v0.142 solved the problem.

@McShelby
Copy link
Owner

Would still be possible to take a look into your repo? As the theme claims to be compatible down to Hugo 0.126.0, I want to make sure that this is still the case.

@retorquere
Copy link
Author

Absolutely -- really appreciate the follow-up! My repo is https://github.com/retorquere/zotero-better-bibtex/ but its setup is a little arcane; I have zipped up the pre-hugo-run state of the relevant part of the repo and uploaded it to https://limewire.com/d/7ee5344e-6885-406a-9e33-d2b9f219c2be#zB6wVOr3zcWBteQvW1djow6ddoJchlXYnlE5R6rPszM

0.142 works most of the time; I do still get the error sometimes, which is a little strange, as it does so under what I had assumed to be stable circumstances on github actions.

McShelby added a commit that referenced this issue Jan 31, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@McShelby McShelby changed the title render failed: failed to execute template theme: guard access to page.File.Filename #1005 Jan 31, 2025
@McShelby McShelby self-assigned this Jan 31, 2025
@McShelby McShelby added the bug Something isn't working label Jan 31, 2025
@McShelby McShelby added this to the 7.4.0 milestone Jan 31, 2025
@McShelby
Copy link
Owner

McShelby commented Jan 31, 2025

Thanks for reporting. I've pushed a fix to the themes main branch.

@McShelby McShelby changed the title theme: guard access to page.File.Filename #1005 theme: guard access to page.File.Filename Jan 31, 2025
McShelby added a commit that referenced this issue Feb 7, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants