osprey icon indicating copy to clipboard operation
osprey copied to clipboard

When building/serving, "error calling index: index of untyped nil"

Open ryanstraight opened this issue 6 years ago • 3 comments

Attempting to build/serve site and receive this error. Osprey version 1.3.0, Hugo version 0.52/extended windows/amd64.

Building sites … ERROR 2018/12/19 08:57:13 render of "page" failed: execute of template failed: template: _default/single.html:3:5: executing "_default/single.html" at <partial " header.html...>: error calling partial: "C:\Hugo\Sites\site\git\themes\osprey\layouts\partials\header.html:79:95": execute of template failed: template: partials/header.html :79:95: executing "partials/header.html" at <index .Site.Data.cac...>: error calling index: index of untyped nil

ERROR 2018/12/19 08:57:13 render of "page" failed: execute of template failed: template: _default/single.html:3:5: executing "_default/single.html" at <partial "header.html...>: error calling partial: "C:\Hugo\Sites\site\git\themes\osprey\layouts\partials\header.html:79:95": execute of template failed: template: partials/header.html:79:95: executing "partials/header.html" at <index .Site.Data.cac...>: error calling index: index of untyped nil

ERROR 2018/12/19 08:57:13 render of "page" failed: execute of template failed: template: _default/single.html:3:5: executing "_default/single.html" at <partial "header.html...>: error calling partial: "C:\Hugo\Sites\site\git\themes\osprey\layouts\partials\header.html:79:95": execute of template failed: template: partials/header.html:79:95: executing "partials/header.html" at <index .Site.Data.cac...>: error calling index: index of untyped nil Total in 175 ms

Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template: index.html:3:5: executing "index.html" at <partial "header.html ...>: error calling partial: "C:\Hugo\Sites\site\git\themes\osprey\layouts\partials\header.html:79:95": execute of template failed: template: partials/header.html:79:95: exe cuting "partials/header.html" at <index .Site.Data.cac...>: error calling index: index of untyped nil

ryanstraight avatar Dec 19 '18 16:12 ryanstraight

@ryanstraight, could I please see your config file also? Did you try to set up cache busting of assets?

tomanistor avatar Dec 20 '18 03:12 tomanistor

FWIW @ryanstraight when I updated the two lines from the included config.toml

from

# Cache busting of static resources (additional set up required)
cacheBustCSS = true
cacheBustJS = true

to

# Cache busting of static resources (additional set up required)
cacheBustCSS = false
cacheBustJS = false

the site loaded for me. I did not set up cachebusting initially, so it should probably work for you too if you hadn't set it up.

chrisarusso avatar Dec 26 '18 08:12 chrisarusso

That's likely the issue.

That cache-busting feature was added to the theme before Hugo Asset Pipelines were released with Hugo v0.43. One of my goals is to update this theme to use the Hugo Asset Pipelines instead of relying on users of the theme manually setting up cache-busting, which would prevent errors like this.

tomanistor avatar Dec 26 '18 18:12 tomanistor