From d9eed7e73b0d27d62043c58c2459d00fd8e98303 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Fri, 6 Dec 2024 18:10:13 +0800 Subject: [PATCH] fix(vercel): add support for Node 22 (v8) (#472) Co-authored-by: Emanuele Stoppa Co-authored-by: Nick Rutten <2504906+nickrttn@users.noreply.github.com> --- .changeset/clever-goats-bake.md | 5 +++++ packages/vercel/src/index.ts | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/clever-goats-bake.md diff --git a/.changeset/clever-goats-bake.md b/.changeset/clever-goats-bake.md new file mode 100644 index 000000000..3abfe53f1 --- /dev/null +++ b/.changeset/clever-goats-bake.md @@ -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 diff --git a/packages/vercel/src/index.ts b/packages/vercel/src/index.ts index 43d794288..1ef65c8d4 100644 --- a/packages/vercel/src/index.ts +++ b/packages/vercel/src/index.ts @@ -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({ @@ -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') {