{"record":{"id":"b3f0d993c8d627fc","repo":"withastro/astro","slug":"the-local-node-js-version-major-is-not-supp","errorCode":null,"errorMessage":"\n\tThe local Node.js version (${major}) is not supported by Vercel Serverless Functions.\n\tYour project will use Node.js 24 as the runtime instead.\n\tConsider switching your local version to 24.\n","messagePattern":"\n\tThe local Node\\.js version \\((.+?)\\) is not supported by Vercel Serverless Functions\\.\n\tYour project will use Node\\.js 24 as the runtime instead\\.\n\tConsider switching your local version to 24\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/integrations/vercel/src/index.ts","lineNumber":792,"sourceCode":"\t\t\tnew URL('./middleware.mjs', functionFolder),\n\t\t\tmiddlewareSecret,\n\t\t\tthis.logger,\n\t\t\tisrForwarding,\n\t\t);\n\n\t\tawait writeJson(new URL(`./.vc-config.json`, functionFolder), {\n\t\t\truntime: 'edge',\n\t\t\tentrypoint: 'middleware.mjs',\n\t\t});\n\t}\n}\n\nfunction getRuntime(process: NodeJS.Process, logger: AstroIntegrationLogger): Runtime {\n\tconst version = process.version.slice(1); // 'v18.19.0' --> '18.19.0'\n\tconst major = version.split('.')[0]; // '18.19.0' --> '18'\n\tconst support = SUPPORTED_NODE_VERSIONS[major];\n\tif (support === undefined) {\n\t\tlogger.warn(\n\t\t\t`\\n` +\n\t\t\t\t`\\tThe local Node.js version (${major}) is not supported by Vercel Serverless Functions.\\n` +\n\t\t\t\t`\\tYour project will use Node.js 24 as the runtime instead.\\n` +\n\t\t\t\t`\\tConsider switching your local version to 24.\\n`,\n\t\t);\n\t\treturn 'nodejs24.x';\n\t}\n\tif (support.status === 'default' || support.status === 'available') {\n\t\treturn `nodejs${major}.x`;\n\t}\n\tif (support.status === 'retiring') {\n\t\tif (support.warnDate && new Date() >= support.warnDate) {\n\t\t\tlogger.warn(\n\t\t\t\t`Your project is being built for Node.js ${major} as the runtime, which is retiring by ${support.removal}.`,\n\t\t\t);\n\t\t}\n\t\treturn `nodejs${major}.x`;\n\t}","sourceCodeStart":774,"sourceCodeEnd":810,"githubUrl":"https://github.com/withastro/astro/blob/3578d45d34226d63cff3d261c971c221de6794d2/packages/integrations/vercel/src/index.ts#L774-L810","documentation":"While generating per-function .vc-config.json files, the Vercel adapter maps the local Node.js major version to a Vercel serverless runtime via SUPPORTED_NODE_VERSIONS. If the major running the build is not a key in that table (e.g. an odd-numbered, very new, or EOL-and-removed release), getRuntime() warns and pins the deployed functions to nodejs24.x instead, so production runtime differs from your local one.","triggerScenarios":" Running astro build with the Vercel adapter on a Node major absent from SUPPORTED_NODE_VERSIONS (for example Node 21 or a newly released major not yet added to the adapter). support === undefined, the warning prints, and getRuntime returns 'nodejs24.x'.","commonSituations":" CI images or local toolchains pinned to non-LTS or bleeding-edge Node; building in Docker with an exotic Node tag; after Vercel drops an old major (e.g. 16/18) from the support table, older build images start hitting this; version-dependent dependencies (native modules, Intl behavior) behaving differently locally vs deployed.","solutions":["Switch the build environment to Node 24 (matching the fallback runtime): use a .nvmrc / .node-version file with '24' or update the CI image (e.g. actions/setup-node with node-version: 24).","Upgrade @astrojs/vercel if a newer release added support for your Node major.","Pin engines.node in package.json (e.g. \">=24\") so the toolchain fails loudly instead of silently deploying a different runtime.","Rebuild; the warning disappears and local and deployed runtimes match."],"exampleFix":"# before\n# .nvmrc\n20.11.0\n\n# after\n# .nvmrc\n24","handlingStrategy":"validation","validationCode":"const major = Number(process.versions.node.split('.')[0]);\nconst SUPPORTED = [20, 22, 24]; // keep in sync with @astrojs/vercel\nif (!SUPPORTED.includes(major)) {\n  throw new Error(\n    `Node ${major} is not a supported Vercel serverless runtime; switch to 24 or update @astrojs/vercel`,\n  );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the build environment to an LTS Node listed in the adapter's support table (24 is the safe default).","Commit .nvmrc / .node-version and set engines.node so CI cannot drift onto unsupported majors.","Keep @astrojs/vercel updated so newly supported majors are recognized.","Run local production tests (astro preview) under the same Node major to match the deployed runtime."],"tags":["vercel","nodejs","runtime-version","compatibility","build"],"backgroundTag":"unsupported-node-version","analyzedSha":"3578d45d34226d63cff3d261c971c221de6794d2","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}