Question

Hugo deployment error

I’m quite new to this so I apologize if this is not the correct place/way to ask. I have a Hugo site that I’ve been building and I’ve created a GitHub repository for it. I’ve linked them both successfully but the site continually gets the same error when building with hugo -d public on DigitalOcean. When the site is on my system, I can build it with the same command without error perfectly fine, and hugo serve -e production also works without error. The error from Digital Ocean is posted below and I cannot figure out it’s cause. It says that it is coming from parsing HTML files within the theme, but I have not changed the theme whatsoever (it is straight from it’s repo.)

[2021-12-28 07:04:18] => Building app
[2021-12-28 07:04:18] 
[2021-12-28 07:04:18] Ensuring Hugo is installed
[2021-12-28 07:04:18] Hugo Extended v0.82.0 requested
[2021-12-28 07:04:18] Installing Hugo Extended v0.82.0
[2021-12-28 07:04:18]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[2021-12-28 07:04:18]                                  Dload  Upload   Total   Spent    Left  Speed
100   676  100   676    0     0   3058      0 --:--:-- --:--:-- --:--:--  3045
[2021-12-28 07:04:19] LICENSE
[2021-12-28 07:04:19] README.md
[2021-12-28 07:04:19] hugo
100 13.7M  100 13.7M    0     0  9109k      0  0:00:01  0:00:01 --:--:-- 12.6M
[2021-12-28 07:04:20] Running custom build command: hugo -d public
[2021-12-28 07:04:20] Total in 67 ms
[2021-12-28 07:04:20] Error: add site dependencies: load resources: loading templates: "/workspace/themes/FeelIt/layouts/partials/comment.html:24:1": parse failed: template: partials/comment.html:24: function "erroridf" not defined
[2021-12-28 07:04:20] building: exit status 255
[2021-12-28 07:04:20] ERROR: failed to build: exit status 1
[2021-12-28 07:04:21] 
[2021-12-28 07:04:21] For documentation on the buildpacks used to build your app, please see:
[2021-12-28 07:04:21]    Hugo: https://do.co/apps-buildpack-hugo
[2021-12-28 07:04:21] 
[2021-12-28 07:04:21]  ! Build failed (145)

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @coopersully,

as I see from FeelIt Theme npm packages are needed. Thats why he is not building. The packages are missing.

It seems to be that npm is not available in this Hugo images, so it would not be a fix to copy package.json over from the theme and alter the build command to install packages first (npm -i).

I have a similiar issue with a theme that has npm package dependencies.

For this reason i will give docker a try as mentioned here: https://docs.digitalocean.com/products/app-platform/languages-frameworks/hugo/#go_the-ways-app-platform-works