Hugo install failing on Cloudflare workers

I have successfully installed the Qubt theme locally and it works using ‘hugo server’. But when I try to build locally using ‘npx wrangler dev’ and following the host on cloudflare docs the build.sh script fails when installing hugo with exit code 23.

{
shortMessage: ‘Command failed with exit code 23: chmod a+x build.sh && ./build.sh’,
command: ‘chmod a+x build.sh && ./build.sh’,
escapedCommand: ‘chmod “a+x” build.sh “&&” “./build.sh”’,
exitCode: 23,
signal: undefined,
signalDescription: undefined,
stdout: ‘Installing Dart Sass 1.98.0…\n’ +
‘Installing Go 1.26.1…\n’ +
‘Installing Hugo 0.158.0…’,
stderr: ‘’,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}

Figured it out, a previous failure had left the hugo tar file in the directory causing a curl error. Exit code - everything curl Perhaps the build script should include some cleanup to make sure the environment is ready. Not sure if it’s just me but npx wrangler dev gets itself into a mess, as it immediately rebuilds when it detects a change after the build script completes and errors on the second go around.

That’s an excellent suggestion. See:
https://github.com/gohugoio/hugoDocs/issues/3454

This is the revised build script for hosting on Cloudflare:
https://gohugo.io/host-and-deploy/host-on-cloudflare/#step-2

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.