0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

fix(vercel): add support for Node 22 (#447)

This commit is contained in:
sag​e 2024-11-28 10:10:16 +00:00 committed by GitHub
parent 2363e4710b
commit 527961b02f

View file

@ -60,12 +60,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({
@ -572,7 +574,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') {