Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gen 1: Support Node.js v22 #3978

Open
3 tasks done
kachkaev opened this issue Dec 19, 2024 · 2 comments
Open
3 tasks done

gen 1: Support Node.js v22 #3978

kachkaev opened this issue Dec 19, 2024 · 2 comments
Labels
feature-request New feature or request

Comments

@kachkaev
Copy link

kachkaev commented Dec 19, 2024

Before opening, please confirm:

Amplify Hosting feature

Backend builds, Deployments, Frontend builds

Is your feature request related to a problem? Please describe:

I am using AWS Amplify with Next.js and want to upgrade from Node v18 to node v22 this does not work. In Hosting → Build settings, Build image is set to Amazon Linux 2023 (default), Amplify CLI is set to 12.13.1 and Node.js Version is set to 22.12.0.

When a new deployment runs, I see this:


2024-12-19T15:48:32.815Z [INFO]: # Node version 22.12.0 is available for installation
2024-12-19T15:48:32.892Z [INFO]: # Installing Node version 22.12.0
2024-12-19T15:49:45.896Z [INFO]: # Now using Node version 22.12.0
2024-12-19T15:49:46.369Z [INFO]: # NPM package '@aws-amplify/cli' already at version '12.13.1'
2024-12-19T15:49:46.373Z [INFO]: # Retrieving cache...
2024-12-19T15:49:46.373Z [INFO]: # Retrieved cache
2024-12-19T15:49:51.182Z [INFO]: ## Starting Backend Build

[...Next.js and backend functions build...]

2024-12-19T15:55:50.742Z [INFO]: # Completed phase: build
## Completed Frontend Build
2024-12-19T15:55:50.778Z [INFO]: ## Build completed successfully
2024-12-19T15:56:13.412Z [ERROR]: !!! CustomerError: Unsupported NodeJS version: v22.12.0. Supported versions are 16, 18 and 20.

If I go back to Hosting → Build settings, set Node.js Version to 20.18.1 and re-deploy, all works:

[...Next.js and backend functions build...]

2024-12-19T15:07:32.566Z [INFO]: # Completed phase: build
## Completed Frontend Build
2024-12-19T15:07:32.600Z [INFO]: ## Build completed successfully
2024-12-19T15:08:16.865Z [INFO]: # Starting environment caching...
2024-12-19T15:08:16.950Z [INFO]: # Uploading environment cache artifact...
2024-12-19T15:08:17.010Z [INFO]: # Uploaded environment cache artifact
2024-12-19T15:08:17.010Z [INFO]: # Environment caching completed

What is causing CustomerError: Unsupported NodeJS version: v22.12.0? How can I upgrade to v22?

Describe how you'd like this feature to work

I would like to be able to define Node v22 in Build settings and get the app deployed. Node.js 22 is already supported in AWS Lambdas (source: AWS Compute Blog).

Potentially related

@kachkaev kachkaev added the feature-request New feature or request label Dec 19, 2024
Copy link

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

@kachkaev
Copy link
Author

kachkaev commented Dec 20, 2024

Looking at Amplify docs (https://docs.aws.amazon.com/amplify/latest/userguide/ssr-deployment-specification.html), I don’t see signs of Node 22 support. For example, there is this:

type ComputeRuntime = 'nodejs16.x' | 'nodejs18.x' | 'nodejs20.x';

and this:

Screenshot 2024-12-20 at 01 54 24

Three versions match the range I am seeing in the deployment output (log shared earlier):

2024-12-19T15:56:13.412Z [ERROR]: !!! CustomerError: Unsupported NodeJS version: v22.12.0.
Supported versions are 16, 18 and 20.

That can be the sign of Node v22 being unsupported by the Amplify gen1 entirely. It’d be great to see this resolved because Node v22 has been LTS since October 2024 and has been available in AWS Lambdas since November 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant