Search code examples
amazon-web-servicesnuxt.jsaws-amplifynuxtjs3nuxt3

AWS Amplify - NUXT 3 deploy


I am trying to deploy a NUXT 3 project with SSG. I got a deploy issue.

My amplify.yml:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - nvm use 18 && node --version
        - npm install -g pnpm
        - pnpm install
    build:
      commands:
        - pnpm run generate
  artifacts:
    baseDirectory: ".output/public/"
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

And here is there error at deploy :

2024-04-05T08:18:46.618Z [ERROR]: !!! CustomerError: Failed to find the deploy-manifest.json file in the build output. Please verify that it exists within the "baseDirectory" specified in your buildSpec. If it's not there, we will also check the .amplify-hosting directory as a fallback. When using a framework adapter for hosting on Amplify, double-check that the adapter settings are correct.

Any idea ? Aws should not create the file deploy-manifest.json ?


Solution

  • I faced this error too and it was because initially in the same Amplify app I had a successful build with a nuxt build for a SSR app. But afterwards I switched to a static website with nuxt generate which led to this error.

    Exact words from the support:

    "Since Amplify detected this App as SSR, it updated the platform to WEB_COMPUTE, which is the compute engine for Amplify SSR Apps.

    I can see that you have subsequently updated the buildSpec to deploy a static Nuxt App, however the platform is still configured to WEB_COMPUTE. This build is failing during deployment because Amplify expects additional SSR related artifacts for SSR deployments that are not present since the build commands are generating a static App."

    I fixed it with the following CLI command:

    aws amplify update-app --app-id <app-id> --platform WEB --region <region>

    Hope this helps!