Problem with Hugo on Amplify using WebP

Howdy,

I’ve been successfully using Hugo in AWS Amplify for some months now. I’m currently using 0.91.2 in the build process. One challenge I have not overcome is handling webp files. I’ve omited some stacktrace.

Start building sites …
hugo v0.91.2-1798BD3F linux/amd64 BuildDate=2021-12-23T15:33:34Z 
VendorInfo=gohugoio
...
Error: Error building site: failed to render pages:
...
at <.Resize>: error calling Resize: image  
...
this feature is not available in your current Hugo version,
 see https://goo.gl/YMrWcn for more information

I run the same version of Hugo on my laptop, and it has never had this problem. Methinks Amplify is not using 0.91.2. This problem persists through prior versions (latest being 0.89.2). I’ve narrowed it down to webp by removing references to webp in my resize; it works as expected then.

Has anyone encountered/resolved this?

WebP support is only available in Hugo Extended.

1 Like

Nothing like a brief response that solves the problem. :slight_smile:

For posterity, this is the Amplify build file I am using (which includes Tailwind):

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - yarn install
        - wget https://github.com/gohugoio/hugo/releases/download/v${VERSION_HUGO}/hugo_extended_${VERSION_HUGO}_Linux-64bit.tar.gz
        - tar --overwrite -xf hugo_extended_${VERSION_HUGO}_Linux-64bit.tar.gz hugo
        - mv hugo /usr/bin/hugo
    build:
      commands:
        - hugo --gc
  artifacts:
    baseDirectory: public
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
1 Like

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