-
-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Following the official installation instructions at https://theme-cards.hbstack.dev/docs/install-from-scratch/, the last step (npm run dev) fails with the following error when using Hugo ≥ v0.156.0:
huge: downloading modules …
hugo: collected modules in 87854 ms
ERROR "/home/myuser/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/hugomods/giscus@v0.1.1/layouts/partials/giscus/repo-id.html:1:1": parse of template failed: template: _partials/giscus/repo-id.html:1: function "getJSON" not defined
Root cause
The getJSON template function was deprecated in Hugo v0.123.0 and permanently removed in Hugo v0.156.0 (see Hugo v0.156.0 release notes). The dependency github.com/hugomods/giscus@v0.1.1 still uses getJSON in layouts/partials/giscus/repo-id.html, which causes a hard parse error on Hugo ≥ v0.156.0.
Environment
- Hugo version: 0.157.0
- OS: Arch Linux
- Affected dependency:
github.com/hugomods/giscus@v0.1.1 - Last known working Hugo version: 0.155.3
Steps to reproduce
- Follow the instructions at https://theme-cards.hbstack.dev/docs/install-from-scratch/
- Run
npm run dev(which runshugo server --gc -D) - Observe the error above
Expected behavior
hugo server starts without errors.
Suggested fix
The getJSON call in github.com/hugomods/giscus should be replaced with resources.GetRemote combined with transform.Unmarshal, as recommended by Hugo's migration guide. This may require updating the dependency on hugomods/giscus to a version that has already applied this fix, or patching it directly.