Hugo's resources.GetRemote

I’ve just started using resources.GetRemote with Hugo, and now the build is failing. It was fine using resources.Get to access a local file, but seems to struggle with an external one.

The log shows:


Error: Error building site: failed to render pages: render of "page" failed: "/opt/build/repo/layouts/_default/baseof.html:193:25": execute of template failed: template: custom/examples.html:193:25: executing "custom/examples.html" at <resources>: can't evaluate field GetRemote in type interface {}

──────────────────────────────────────────────
"build.command" failed                                        
──────────────────────────────────────────────
Error message
Command failed with exit code 255: hugo
Error location
In Build command from Netlify app:
hugo
Resolved config
build:
  command: hugo
  commandOrigin: ui
  environment:
    - ONEGRAPH_AUTHLIFY_TOKEN
  publish: /opt/build/repo/public
  publishOrigin: ui

Has anyone used Hugo to pull in external resources? It seems to work fine on my local machine, both using the inbuilt server and building the static files.

hi there,

error 255 is a pretty common one for people who use hugo, sadly. but you are in luck as many other people have posted about it before.

could you go through these posts and see if there is anything there that fixes your problem?

https://answers.netlify.com/search?q=255%20hugo

1 Like

Thanks Perry. One of the articles there pointed me towards setting the version of Hugo via an environment variable. Looking back at the first error I got, it was using v0.85.0 and the current is v0.94.0. Forcing that to be current seems to have resolved the issue.

1 Like

Thanks so much for coming back and letting us know! Glad everything is working now. Happy building, @Slicx :rocket: