Skip to content

Commit 42ef004

Browse files
jat001ascorbicflorian-lefebvre
authored
chore(vercel): change the default node version to 22. (#14077)
* Change the default node version to 22. https://vercel.com/changelog/node-js-18-is-being-deprecated * add changeset * Update .changeset/brave-wombats-jam.md * Update .changeset/brave-wombats-jam.md Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> --------- Co-authored-by: Matt Kane <m@mk.gg> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
1 parent 04e6011 commit 42ef004

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.changeset/brave-wombats-jam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/vercel': patch
3+
---
4+
5+
Changes the default Node.js version of Vercel functions to 22

packages/integrations/vercel/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const SUPPORTED_NODE_VERSIONS: Record<
7070
| { status: 'retiring'; removal: Date | string; warnDate: Date }
7171
| { status: 'deprecated'; removal: Date }
7272
> = {
73-
18: { status: 'retiring', removal: 'Early 2025', warnDate: new Date('October 1 2024') },
73+
18: { status: 'retiring', removal: new Date('September 1 2025'), warnDate: new Date('October 1 2024') },
7474
20: { status: 'available' },
7575
22: { status: 'default' },
7676
};
@@ -703,10 +703,10 @@ function getRuntime(process: NodeJS.Process, logger: AstroIntegrationLogger): Ru
703703
logger.warn(
704704
`\n` +
705705
`\tThe local Node.js version (${major}) is not supported by Vercel Serverless Functions.\n` +
706-
`\tYour project will use Node.js 18 as the runtime instead.\n` +
707-
`\tConsider switching your local version to 18.\n`,
706+
`\tYour project will use Node.js 22 as the runtime instead.\n` +
707+
`\tConsider switching your local version to 22.\n`,
708708
);
709-
return 'nodejs18.x';
709+
return 'nodejs22.x';
710710
}
711711
if (support.status === 'default' || support.status === 'available') {
712712
return `nodejs${major}.x`;
@@ -733,11 +733,11 @@ function getRuntime(process: NodeJS.Process, logger: AstroIntegrationLogger): Ru
733733
`\n` +
734734
`\tYour project is being built for Node.js ${major} as the runtime.\n` +
735735
`\tThis version is deprecated by Vercel Serverless Functions, and scheduled to be disabled on ${removeDate}.\n` +
736-
`\tConsider upgrading your local version to 18.\n`,
736+
`\tConsider upgrading your local version to 22.\n`,
737737
);
738738
return `nodejs${major}.x`;
739739
}
740-
return 'nodejs18.x';
740+
return 'nodejs22.x';
741741
}
742742

743743
function createConfigHeaders(staticHeaders: RouteToHeaders, config: AstroConfig): Header[] {

0 commit comments

Comments
 (0)