paige: Invalid memory address or nil pointer dereference on Windows
When trying to build exampleSite on Windows, it errors, but in Ubuntu, it is working.
cd exampleSite
hugo --themesDir ../..
Start building sites …
hugo v0.109.0-47b12b83e636224e5e601813ff3e6790c191e371 windows/amd64 BuildDate=2022-12-23T10:38:11Z VendorInfo=gohugoio
ERROR 2023/01/10 12:54:41 render of "page" failed: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\_default\baseof.html:5:7": execute of template failed: template: _default/single.html:5:7: executing "_default/single.html" at <partial "paige/head.html" .>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\head.html:4:7": execute of template failed: template: partials/paige/head.html:4:7: executing "partials/paige/head.html" at <partial "paige/links.html" .>: error calling partial: execute of template failed: template: partials/paige/links.html:16:3: executing "partials/paige/links.html" at <partial "paige/link.html" (dict "href" (.Site.Params.paige.bootstrap.style.link_href | default "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css") "integrity" .Site.Params.paige.bootstrap.style.link_integrity "remote" .Site.Params.paige.bootstrap.style.remote)>: error calling partial: execute of template failed: template: partials/paige/link.html:11:21: executing "partials/paige/link.html" at <partial "paige/func-resource.html" (dict "page" $page "url" $href)>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\func-resource.html:11:25": execute of template failed: template: partials/paige/func-resource.html:11:25: executing "partials/paige/func-resource.html" at <resources.GetMatch>: error calling GetMatch: runtime error: invalid memory address or nil pointer dereference
ERROR 2023/01/10 12:54:41 render of "page" failed: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\_default\baseof.html:5:7": execute of template failed: template: _default/single.html:5:7: executing "_default/single.html" at <partial "paige/head.html" .>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\head.html:4:7": execute of template failed: template: partials/paige/head.html:4:7: executing "partials/paige/head.html" at <partial "paige/links.html" .>: error calling partial: execute of template failed: template: partials/paige/links.html:16:3: executing "partials/paige/links.html" at <partial "paige/link.html" (dict "href" (.Site.Params.paige.bootstrap.style.link_href | default "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css") "integrity" .Site.Params.paige.bootstrap.style.link_integrity "remote" .Site.Params.paige.bootstrap.style.remote)>: error calling partial: execute of template failed: template: partials/paige/link.html:11:21: executing "partials/paige/link.html" at <partial "paige/func-resource.html" (dict "page" $page "url" $href)>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\func-resource.html:11:25": execute of template failed: template: partials/paige/func-resource.html:11:25: executing "partials/paige/func-resource.html" at <resources.GetMatch>: error calling GetMatch: runtime error: invalid memory address or nil pointer dereference
ERROR 2023/01/10 12:54:41 render of "page" failed: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\_default\baseof.html:5:7": execute of template failed: template: _default/paige/search.html:5:7: executing "_default/paige/search.html" at <partial "paige/head.html" .>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\head.html:4:7": execute of template failed: template: partials/paige/head.html:4:7: executing "partials/paige/head.html" at <partial "paige/links.html" .>: error calling partial: execute of template failed: template: partials/paige/links.html:16:3: executing "partials/paige/links.html" at <partial "paige/link.html" (dict "href" (.Site.Params.paige.bootstrap.style.link_href | default "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css") "integrity" .Site.Params.paige.bootstrap.style.link_integrity "remote" .Site.Params.paige.bootstrap.style.remote)>: error calling partial: execute of template failed: template: partials/paige/link.html:11:21: executing "partials/paige/link.html" at <partial "paige/func-resource.html" (dict "page" $page "url" $href)>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\func-resource.html:11:25": execute of template failed: template: partials/paige/func-resource.html:11:25: executing "partials/paige/func-resource.html" at <resources.GetMatch>: error calling GetMatch: runtime error: invalid memory address or nil pointer dereference
ERROR 2023/01/10 12:54:41 render of "page" failed: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\_default\baseof.html:5:7": execute of template failed: template: _default/single.html:5:7: executing "_default/single.html" at <partial "paige/head.html" .>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\head.html:4:7": execute of template failed: template: partials/paige/head.html:4:7: executing "partials/paige/head.html" at <partial "paige/links.html" .>: error calling partial: execute of template failed: template: partials/paige/links.html:16:3: executing "partials/paige/links.html" at <partial "paige/link.html" (dict "href" (.Site.Params.paige.bootstrap.style.link_href | default "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css") "integrity" .Site.Params.paige.bootstrap.style.link_integrity "remote" .Site.Params.paige.bootstrap.style.remote)>: error calling partial: execute of template failed: template: partials/paige/link.html:11:21: executing "partials/paige/link.html" at <partial "paige/func-resource.html" (dict "page" $page "url" $href)>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\func-resource.html:11:25": execute of template failed: template: partials/paige/func-resource.html:11:25: executing "partials/paige/func-resource.html" at <resources.GetMatch>: error calling GetMatch: runtime error: invalid memory address or nil pointer dereference
Error: Error building site: failed to render pages: render of "page" failed: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\_default\baseof.html:5:7": execute of template failed: template: _default/single.html:5:7: executing "_default/single.html" at <partial "paige/head.html" .>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\head.html:4:7": execute of template failed: template: partials/paige/head.html:4:7: executing "partials/paige/head.html" at <partial "paige/links.html" .>: error calling partial: execute of template failed: template: partials/paige/links.html:16:3: executing "partials/paige/links.html" at <partial "paige/link.html" (dict "href" (.Site.Params.paige.bootstrap.style.link_href | default "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css") "integrity" .Site.Params.paige.bootstrap.style.link_integrity "remote" .Site.Params.paige.bootstrap.style.remote)>: error calling partial: execute of template failed: template: partials/paige/link.html:11:21: executing "partials/paige/link.html" at <partial "paige/func-resource.html" (dict "page" $page "url" $href)>: error calling partial: "D:\a\github-actions-testing\github-actions-testing\paige\layouts\partials\paige\func-resource.html:11:25": execute of template failed: template: partials/paige/func-resource.html:11:25: executing "partials/paige/func-resource.html" at <resources.GetMatch>: error calling GetMatch: runtime error: invalid memory address or nil pointer dereference
Total in 246 ms
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 24 (11 by maintainers)
@AnimMouse Thank you for your report!
I thought it would be good to keep deps out of the repo to make it smaller. It’s already too large, in my opinion. I’m going to try to slim it down in the future. Fortunately, Hugo supports this.
How are you deploying to Cloudflare Pages?
Are you using https://github.com/cloudflare/pages-action in a GitHub workflow? If so, the doc there says you can put your own build actions in the middle:
You can put
npm installthere. For example:All the GitHub runners have npm installed.
See the changes to
.github/workflows/pages.ymlin https://github.com/willfaught/paige/commit/24be3b3230046642f55bcea8a3b5e577e818a2ed for an example of how Paige does it for the example site.My pleasure.
@rogerssam Take a look at the current menu of the exampleSite. “Content” is the name of a section that shows how standard content is displayed in the theme. It’s adjacent to other sections that show off the theme’s shortcodes (“Shortcodes”), layouts (“Layouts”), and so on. There’s no single “posts” or “blog” section that can correspond to the “content” section in this context.
Some alternative section names that seemed worse than “Content” to me:
I couldn’t think of anything better. 🤷♂️
The other sections also have lists of links to pages in those sections, so it would be confusing for only one of them to be called that. That name also wouldn’t describe what kind of pages are in that section. Hence, the current situation. 😃 Thanks for your suggestions.
Yeah fair comment, I see what you mean.
You could call the section name “List-style content”? I realise it’s long (not ideal), but perhaps clearer what it’s demoing? Or maybe even just “Lists” or “Articles”? I would still suggest that “Posts” would give that information to new users because I figure most people are going to want to use that section for blog-style content, so making it clear that’s where/how it will display is probably useful.
You could also change this line to something like “Demonstrations of Paige list-style content (suitable for blogs, articles etc)”.
At the end of the day it probably doesn’t matter too much 😃 Thanks for your work with this theme - it’s very impressive!
I wasn’t thrilled with the name, either, but I couldn’t think of a better one. Suggestions are welcome.
Thanks, @rogerssam!
@AnimMouse @luisimasd @Dekker500 Does it work for you?
I can confirm this works for me with a blank site using the default exampleSite config and content. Thanks!
After some debugging, I might have a fix. The error still happens on a GitHub runner running Windows Server, but it doesn’t happen on a PC running Windows 11. Would someone please test v0.39.0 and report back?
@rogerssam Were you using Windows too?
We haven’t edited any configuration, I basically run Hugo on your exampleSite folder on Windows.
Since I saw you use GitHub Actions for CI/CD, you can use GitHub Actions’ Windows runners by using
runs-on: windows-lateston your current workflow. If you have a Windows computer, you don’t need WSL, you can run it on command prompt.The logs below are created on GitHub Actions Windows runners for clean reproducible environment.
Logs as of be578407421b686b9a6f7ef36d653a73fa6ffbe5:
Hugo extended:
I won’t be able to test until the 20th, however the site config was the one you provided. The course shown above is the exact sequence I followed in a brand new folder.
Will report after the 20th… Sorry!
I am seeing the same problem.
The problem is showing on a raw, clean base new site created with your template, with no modifications.