Home > OS >  Errors hosting hugo website on cloudflare
Errors hosting hugo website on cloudflare

Time:11-16

I am trying to host a hugo site I made on cloudflare but it keeps giving me error when it tried to build the site, the site uses a custom build command and it works just fine on my pc (which is running windows 10). I am not exactly sure what the error is but I think it has something to do with calling the other files. any help would be much appreciated.

(Cloudflare is cloning the site from my Github repo)

Here are the logs from cloudflare:

Executing user command: hugo server -t hugo-theme-shell -w -D

2022-11-13T23:03:07.769635Z Building sites … ERROR 2022/11/13 23:03:07 render of "home" failed: execute of template failed: template: index.html:3:8: executing "index.html" at <partial "head.html" ...>: error calling partial: "/opt/buildhome/repo/themes/hugo-theme-shell/layouts/partials/head.html:6:7": execute of template failed: template: partials/head.html:6:7: executing "partials/head.html" at <partial "themes/hugo...>: error calling partial: Partial "themes/hugo-theme-shell/layouts/partials/style.html" not found

2022-11-13T23:03:07.769998Z ERROR 2022/11/13 23:03:07 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:3:8: executing "_default/list.html" at <partial "head.html" ...>: error calling partial: "/opt/buildhome/repo/themes/hugo-theme-shell/layouts/partials/head.html:6:7": execute of template failed: template: partials/head.html:6:7: executing "partials/head.html" at <partial "themes/hugo...>: error calling partial: Partial "themes/hugo-theme-shell/layouts/partials/style.html" not found

2022-11-13T23:03:07.770177Z Total in 3 ms

2022-11-13T23:03:07.770303Z Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:3:8: executing "_default/list.html" at <partial "head.html" ...>: error calling partial: "/opt/buildhome/repo/themes/hugo-theme-shell/layouts/partials/head.html:6:7": execute of template failed: template: partials/head.html:6:7: executing "partials/head.html" at <partial "themes/hugo...>: error calling partial: Partial "themes/hugo-theme-shell/layouts/partials/style.html" not found 2022-11-13T23:03:07.77619Z Failed: build command exited with code: 255

2022-11-13T23:03:08.586593Z Failed: an internal error occurred

I tried going through the files but I was having a hard time understanding what the errors were and what was causing them.

I also tried making sure all the files were uploaded to Github properly.

CodePudding user response:

I suggest you share your github repo, because otherwise it is difficult to analyze.

It could be:

  1. an issue with the directory structure in Windows vs when deploying in GitHub. Check in particular the slashes and backslashes that behave differently.
  2. a difference between the hugo version used by GitHub to render your site, and the one you use on your local computer
  3. an issue with the CloudFlare page deployment module, which is still quite new. See the known limitations below. And you can also have a look at similar issues in the CloudFlare community forum. https://developers.cloudflare.com/pages/platform/known-issues/

If you can not fix it, an alternative would be to render the site on your desktop, then commit on github with Hugo public/ directory, and then use CloudFlare Pages without the Hugo deployment, just using pointing to your public/ directory.

CodePudding user response:

"Partial "themes/hugo-theme-shell/layouts/partials/style.html" not found"

It can't find the partial "style.html"

  • Related