Hugo Build Warnings

I keep getting these warnings when building with Hugo. These warnings don’t occur in localhost using $ hugo serve.

WARN 2021/12/03 14:26:12 found no layout file for "JSON" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

I assume this is due to Pages using an older instance of Hugo. How to remove these warnings?

Could you please run the command “hugo” on localhost?
So just “hugo” without anything else and see if then some errors are comming up.

Another question: is your theme a git submodule?

To change Hugo (or Node, NPM, YARN) version please dfollow this doc: https://developers.cloudflare.com/pages/platform/build-configuration#language-support-and-tools

Tools Notes Environment variable
Hugo Version 0.54 HUGO_VERSION

While I perosnally think it would be way more clever to make Cloudflare read it out of a file from the Git-Repo as you then could change it within your IDE and you would not need to log into Cloudflare.

But these are just my 2cents.

So just “ hugo ” without anything else and see if then some errors are coming up.

No errors come up

is your theme a git submodule

I am not using a theme. I have all my layouts in the layouts folder and assets in the static folder.

To change Hugo (or Node, NPM, YARN) version please follow this doc:

I already have the Hugo version set in settings.

While I personally think it would be way more clever to make Cloudflare read it out of a file from the Git-Repo as you then could change it within your IDE and you would not need to log into Cloudflare.

Read what? Hugo version?

The error is pretty clear. You have no layout. Make sure your root and output folder are correct.

If those are correct, make sure you can run the command locally and it outputs a build. Also make sure your configured Hugo version matches local.

They are. As I said, this error only occurs on Pages, not local.

make sure you can run the command locally and it outputs a build

It does. Otherwise, my site would not be up.

Also make sure your configured Hugo version matches local.

Again, the version set is correct. I even added the go version in Hugo docs and I still get the warning.

Please share the repo, there isn’t much support that can be given without it

1 Like

You stated this error also occurs on Netlify so I think it is a general (but not locally) problem:

Source: Disable warnings during build - #14 by afrique - support - HUGO

Like @Walshy stated, to debug this you would have to share the repo.
Anyway please check if there are any other submodules on your repo (other repos, linked to you repo) which are required to build the page.

And please read this, as this seems to be the same error as you have: Site not displaying after moving files from Linux to Windows - support - HUGO

1 Like

Found the issue. It was a config file error. Consider this solved.

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