Skip to content

Build fails - related to Scratch in meta.html #206

@TheGroundZero

Description

@TheGroundZero

Hi

I was attempting to to migrate my site from its current theme to this one but on build (using Github Actions) it fails.

I notice two different error messages:

  • <.Scratch.Add>: error calling Add: runtime error: invalid memory address or nil pointer dereference (occurs twice)
  • Scratch is nil; wrap it in if or with

Both related to layouts/partials/head/meta.html

Run peaceiris/actions-hugo@v3
  with:
    hugo-version: latest
    extended: true
[...]
Run hugo --gc --minify --environment staging
ERROR render of "section" failed: "/home/runner/work/sequr/sequr/themes/poison/layouts/_default/baseof.html:1:3": execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "head/head.html" .>: error calling partial: "/home/runner/work/sequr/sequr/themes/poison/layouts/partials/head/head.html:16:7": execute of template failed: template: partials/head/head.html:16:7: executing "partials/head/head.html" at <partial "head/meta.html" .>: error calling partial: "/home/runner/work/sequr/sequr/themes/poison/layouts/partials/head/meta.html:17:13": execute of template failed: template: partials/head/meta.html:17:13: executing "partials/head/meta.html" at <.Scratch.Add>: error calling Add: runtime error: invalid memory address or nil pointer dereference
ERROR render of "page" failed: "/home/runner/work/sequr/sequr/themes/poison/layouts/_default/baseof.html:1:3": execute of template failed: template: _default/single.html:1:3: executing "_default/single.html" at <partial "head/head.html" .>: error calling partial: "/home/runner/work/sequr/sequr/themes/poison/layouts/partials/head/head.html:16:7": execute of template failed: template: partials/head/head.html:16:7: executing "partials/head/head.html" at <partial "head/meta.html" .>: error calling partial: "/home/runner/work/sequr/sequr/themes/poison/layouts/partials/head/meta.html:23:13": execute of template failed: template: partials/head/meta.html:23:13: executing "partials/head/meta.html" at <.Scratch.Add>: error calling Add: runtime error: invalid memory address or nil pointer dereference
Total in 2341 ms
Error: error building site: render: failed to render pages: render of "page" failed: "/home/runner/work/sequr/sequr/themes/poison/layouts/_default/baseof.html:1:3": execute of template failed: template: _default/single.html:1:3: executing "_default/single.html" – Scratch is nil; wrap it in if or with: {{ with partial "head/head.html" .>: error calling partial: "/home/runner/work/sequr/sequr/themes/poison/layouts/partials/head/head.html:16:7": execute of template failed: template: partials/head/head.html:16:7: executing "partials/head/head.html" at <partial "head/meta.html" .>: error calling partial: "/home/runner/work/sequr/sequr/themes/poison/layouts/partials/head/meta.html:23:13": execute of template failed: template: partials/head/meta.html:23:13: executing "partials/head/meta.html" at <.Scratch }}{{ .Add }}{{ end }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions