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

<nil> is not a Resource #6128

Closed
bep opened this issue Jul 28, 2019 · 2 comments

Comments

@bep
Copy link
Member

commented Jul 28, 2019

error calling fingerprint: <nil> is not a Resource

Got the above and similar when porting gohugoioTheme to a module in Hugo Docs today.

@bep bep added this to the v0.56.2 milestone Jul 28, 2019

@bep bep closed this in e5f9602 Jul 29, 2019

@SiamKreative

This comment has been minimized.

Copy link

commented Aug 15, 2019

@bep How was this solved? I am running into a very similar issue on Cactus theme

executing "partials/head.html" at <toCSS>: error calling toCSS: type <nil> not supported in Resource transformations
@bep

This comment has been minimized.

Copy link
Member Author

commented Aug 15, 2019

You need to do a nil check in the templates. The thing is, resource.Get "someresource.css" returns nil if not found.

We could probably improve the error message, but you need to do something ala:

{ { $scss := resource.Get "foo.scss" }}

{{ if $scss }}
// call toSCSS
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.