Skip to content

AWS Amplify deployment: node version mismatch in build vs runtime #3718

@nimonian

Description

@nimonian

I followed the instructions for deploying Nuxt with Nuxt Content to AWS Amplify. It did not work and I spent some hours debugging. I have found the issue, which I will explain here, and suggest we update the documentation to help future deployers.

The problem is that, to get node:sqlite working, we need node to be version >= 22. In #3589 this is discussed and it turns out we can control the build version on Amplify, meaning the app builds.

However, if we're doing SSR, we also need the runtime version to be at 22. It defaults to 20 in the Amplify runtime even when "live package updates" and amplify.yml are pinned to 22. The latter appears to pertain the the build environment only.

The solution is add to nuxt.config.ts:

  nitro: {
    awsAmplify: {
      runtime: 'nodejs22.x',
    },
  },

So, my suggestion is:

  • Update the docs to make this clear

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions