Successful build in Netlify but not in AWS Amplify

I am trying to move from Netlify DNS to Route 53 and thus moving from Netlify building to AWS Amplify building.

Here is the repo:

  • Note: this has a theme as a submodule

Netlify has always built with standard build settings set to Hugo 0.58.3 (see screenshots


)

AWS Amplify hasn’t completed a build, even though I have completed fine with other Hugo sites and themes.

In AWS i’ve tried different Hugo versions, if extended isn’t specified my build breaks, otherwise it just hangs forever.

Here are two build settings I’ve tried:

Hangs forever:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - 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
        - rm -rf hugo_extended_${VERSION_HUGO}_Linux-64bit.tar.gz
        - hugo version
    build:
      commands:
        - hugo
  artifacts:
    baseDirectory: public
    files:
      - '**/*'
  cache:
    paths: []

Breaks early (needs extended). But works robustly on other hugo sites with a different theme.

version: 1
frontend:
  phases:
    build:
      commands:
        - hugo
  artifacts:
    baseDirectory: public
    files:
      - '**/*'
  cache:
    paths: []

I am stuck on why this site work locally, builds on Netlify, but I am pulling out hair on not building in AWS Amplify.

If anyone has insight for troubleshooting or has solved this, it’s greatly appreciated!

Are you sure that AWS is cloning recursively?
https://dev.to/noahsummers/deploying-a-hugo-site-with-git-submodules-on-aws-amplify-50i5

@jmooring,

Recursive cloning does seem to be working. I did battle this previously in AWS Amplify, though. Submodules also working ok in other builds.

I found a difference in working Amplify apps and this one. In this one the “Framework” listed as “Web” but in working ones it is listed as “Hugo”. However, I haven’t found a way to set Framework.

I “enabled” Amplify studio and all of a sudden it started working. I am going to see if I can zero in on what changed.