Skip to content

chore: update nodejs to 22#270

Merged
revmischa merged 1 commit into
jetbridge:mainfrom
coryasilva:267-update-to-nodejs-22
Dec 7, 2025
Merged

chore: update nodejs to 22#270
revmischa merged 1 commit into
jetbridge:mainfrom
coryasilva:267-update-to-nodejs-22

Conversation

@coryasilva

@coryasilva coryasilva commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

Fixes #267

  • chore: update lambdas to node 22
    • required cdk update, chose latest, hope that is cool with everyone.
  • chore: update package min node to 20
    • removed undici types and dep since node 20 types include this

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Node.js from version 20 to version 22 for AWS Lambda functions, along with updating the CDK to version 2.232.1 and setting the minimum Node.js version to 20.0.0.

Key changes:

  • Lambda runtime updated from NODEJS_20_X to NODEJS_22_X
  • CDK updated from 2.131.0 to 2.232.1
  • Minimum Node.js version updated from 18.18.0 to 20.0.0
  • Removed undici dependency as it's now included in Node 20+ types

Reviewed changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/common-lambda-props.ts Updated runtime to NODEJS_22_X for Lambda functions
src/NextjsDistribution.ts Updated EdgeFunction runtime to NODEJS_22_X (⚠️ Critical Issue)
package.json Updated @types/node to ^20, CDK to 2.232.1, removed undici, updated engines to node >= 20.0.0
.projenrc.ts Updated minNodeVersion to 20.0.0, cdkVersion to 2.232.1, @types/node to ^20, esbuild target to node20
src/types.d.ts Removed file (undici types no longer needed)
yarn.lock Updated dependencies including CDK, @types/node, and removed undici
.projen/tasks.json Updated esbuild target to node20 for bundling tasks
.projen/deps.json Updated @types/node to ^20, aws-cdk-lib to ^2.232.1, removed undici
.github/workflows/*.yml Updated Node.js version to >= 20.0.0 in CI workflows
src/generated-structs/*.ts Updated TypeScript interfaces to match new CDK version APIs
API.md Generated documentation updates reflecting CDK API changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/NextjsDistribution.ts
const signFnUrlDir = path.resolve(__dirname, '..', 'assets', 'lambdas', 'sign-fn-url');
const originRequestEdgeFn = new cloudfront.experimental.EdgeFunction(this, 'EdgeFn', {
runtime: Runtime.NODEJS_20_X,
runtime: Runtime.NODEJS_22_X,

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lambda@Edge (EdgeFunction) does not support Node.js 22.x runtime. As of early 2025, Lambda@Edge only supports runtimes up to Node.js 20.x. The Node.js 22.x runtime is only available for regular Lambda functions, not Lambda@Edge functions. This will cause deployment failures when trying to create the EdgeFunction.

You should keep this EdgeFunction on Runtime.NODEJS_20_X while updating regular Lambda functions to Node.js 22.x.

Suggested change
runtime: Runtime.NODEJS_22_X,
runtime: Runtime.NODEJS_20_X,

Copilot uses AI. Check for mistakes.
Comment thread .projenrc.ts
platform: 'node',
sourcemap: true,
target: 'node18',
target: 'node20',

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The esbuild target is set to node20, but the Lambda runtime is being updated to NODEJS_22_X. For consistency and to potentially take advantage of Node.js 22 features, consider updating the esbuild target to node22. While Node.js 20-compiled code will run on Node.js 22, matching the target to the runtime ensures optimal compatibility and feature usage.

Suggested change
target: 'node20',
target: 'node22',

Copilot uses AI. Check for mistakes.
@revmischa

Copy link
Copy Markdown
Member

Thanks!

@revmischa revmischa merged commit d523bfa into jetbridge:main Dec 7, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Node.js from 20 to 22

3 participants