Skip to content

Commit

Permalink
fix(vercel): add support for Node 22 (v8) (#472)
Browse files Browse the repository at this point in the history
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Nick Rutten <2504906+nickrttn@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 6, 2024
1 parent 1d4e6fc commit d9eed7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-goats-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---

Add back support for Node 22 on Vercel serverless that was fixed in v7 but lost in v8
6 changes: 4 additions & 2 deletions packages/vercel/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ const ISR_PATH = `/_isr?${ASTRO_PATH_PARAM}=$0`;
const SUPPORTED_NODE_VERSIONS: Record<
string,
| { status: 'default' }
| { status: 'available' }
| { status: 'beta' }
| { status: 'retiring'; removal: Date | string; warnDate: Date }
| { status: 'deprecated'; removal: Date }
> = {
18: { status: 'retiring', removal: 'Early 2025', warnDate: new Date('October 1 2024') },
20: { status: 'default' },
20: { status: 'available' },
22: { status: 'default' },
};

function getAdapter({
Expand Down Expand Up @@ -589,7 +591,7 @@ function getRuntime(process: NodeJS.Process, logger: AstroIntegrationLogger): Ru
);
return 'nodejs18.x';
}
if (support.status === 'default') {
if (support.status === 'default' || support.status === 'available') {
return `nodejs${major}.x`;
}
if (support.status === 'retiring') {
Expand Down

0 comments on commit d9eed7e

Please sign in to comment.