Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brave-wombats-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---

Changes the default Node.js version of Vercel functions to 22
12 changes: 6 additions & 6 deletions packages/integrations/vercel/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const SUPPORTED_NODE_VERSIONS: Record<
| { status: 'retiring'; removal: Date | string; warnDate: Date }
| { status: 'deprecated'; removal: Date }
> = {
18: { status: 'retiring', removal: 'Early 2025', warnDate: new Date('October 1 2024') },
18: { status: 'retiring', removal: new Date('September 1 2025'), warnDate: new Date('October 1 2024') },
20: { status: 'available' },
22: { status: 'default' },
};
Expand Down Expand Up @@ -703,10 +703,10 @@ function getRuntime(process: NodeJS.Process, logger: AstroIntegrationLogger): Ru
logger.warn(
`\n` +
`\tThe local Node.js version (${major}) is not supported by Vercel Serverless Functions.\n` +
`\tYour project will use Node.js 18 as the runtime instead.\n` +
`\tConsider switching your local version to 18.\n`,
`\tYour project will use Node.js 22 as the runtime instead.\n` +
`\tConsider switching your local version to 22.\n`,
);
return 'nodejs18.x';
return 'nodejs22.x';
}
if (support.status === 'default' || support.status === 'available') {
return `nodejs${major}.x`;
Expand All @@ -733,11 +733,11 @@ function getRuntime(process: NodeJS.Process, logger: AstroIntegrationLogger): Ru
`\n` +
`\tYour project is being built for Node.js ${major} as the runtime.\n` +
`\tThis version is deprecated by Vercel Serverless Functions, and scheduled to be disabled on ${removeDate}.\n` +
`\tConsider upgrading your local version to 18.\n`,
`\tConsider upgrading your local version to 22.\n`,
);
return `nodejs${major}.x`;
}
return 'nodejs18.x';
return 'nodejs22.x';
}

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