HUGO Image Processing Failure on CloudFlare

When I was trying to deploy my HUGO website on Cloudflare, image process(resize images) failed all the time. However it works perfect locally. Whatever I put the images in the page bundle or assets folder. It just doesn’t work.

I searched but didn’t find out much more related information. I’m wondering if it is Cloudflare blocking image processing feature of HUGO?

Anyone has a clue on that?

The error message:

execute of template failed: template: shortcodes/imgproc.html:15:17: executing "shortcodes/imgproc.html" at <$i.Process>: can't evaluate field Process in type resource.Resource


My first thought would be check if your Hugo versions are the same. Have you tried to Google as well?
This isn’t the exact same but sounds about right - Can't evaluate field Resize in type resource.Resource - #2 by bep - support - HUGO

My HUGO version is 0.119. Cloudflare version is 0.118. I’ll give 0.118 a try.

resource.Process is a recent addition to Hugo – in fact, it was added in version 0.119, so that explains the error, as you’re using 0.119 but have 0.118 on Cloudflare.

You can set the Hugo version Pages will use by adding an environment variable HUGO_VERSION to your project.

That will take care of this error.


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