withastro/astro · warning

Your project is being built for Node.js ${major} as the ru

Error message

	Your project is being built for Node.js ${major} as the runtime.
	This version is deprecated by Vercel Serverless Functions.
	Consider upgrading your local version to 24.

What it means

@astrojs/vercel's getRuntime() (packages/integrations/vercel/src/index.ts:771) maps your local Node.js major to a Vercel Serverless runtime using the SUPPORTED_NODE_VERSIONS table. When the entry has status 'deprecated' (currently Node 18), it prints this multi-line warning and still returns `nodejs18.x` — the build succeeds, but you are deploying to a runtime Vercel no longer supports and which may break or be force-upgraded at any time. Unlike the 'not supported at all' path (which silently falls back to `nodejs24.x`), the deprecated path preserves your major, so local and deployed behavior stay consistent until you upgrade.

Source

Thrown at packages/integrations/vercel/src/index.ts:818

	if (support.status === 'default' || support.status === 'available') {
		return `nodejs${major}.x`;
	}
	if (support.status === 'retiring') {
		if (support.warnDate && new Date() >= support.warnDate) {
			logger.warn(
				`Your project is being built for Node.js ${major} as the runtime, which is retiring by ${support.removal}.`,
			);
		}
		return `nodejs${major}.x`;
	}
	if (support.status === 'beta') {
		logger.warn(
			`Your project is being built for Node.js ${major} as the runtime, which is currently in beta for Vercel Serverless Functions.`,
		);
		return `nodejs${major}.x`;
	}
	if (support.status === 'deprecated') {
		logger.warn(
			`\n` +
				`\tYour project is being built for Node.js ${major} as the runtime.\n` +
				`\tThis version is deprecated by Vercel Serverless Functions.\n` +
				`\tConsider upgrading your local version to 24.\n`,
		);
		return `nodejs${major}.x`;
	}
	return 'nodejs24.x';
}

function createRoutesWithStaticHeaders(
	staticHeaders: RouteToHeaders,
	config: AstroConfig,
): RouteWithSrc[] {
	const vercelHeaders: RouteWithSrc[] = [];
	for (const [pathname, { headers }] of staticHeaders.entries()) {
		if (config.security.csp) {
			const csp = headers.get('Content-Security-Policy');

View on GitHub (pinned to 3578d45d34)

Solutions

  1. Upgrade to Node 24 (the recommended default): update `.nvmrc`/`.node-version`/CI setup-node version to 24, reinstall dependencies, and rebuild.
  2. If 24 is not viable yet, upgrade to a major with status 'available' (20 or 22) as an intermediate step.
  3. Update @astrojs/vercel to the latest version so its deprecation table reflects Vercel's current policy and the suggested target major is accurate.
  4. After upgrading, remove and reinstall node_modules and lockfile entries built under Node 18 (native deps like esbuild/sharp may need rebuilding for the new major).

Example fix

# before: .github/workflows/deploy.yml
- uses: actions/setup-node@v4
  with: { node-version: 18 }

# after
- uses: actions/setup-node@v4
  with: { node-version: 24 }
Defensive patterns

Strategy: validation

Validate before calling

// preflight: fail if the build machine runs a Vercel-deprecated Node major
const major = Number(process.version.slice(1).split('.')[0]);
if (major <= 18) {
  throw new Error(`Node ${major} is deprecated on Vercel Serverless — upgrade to 24`);
}

Prevention

When it happens

Trigger: Running `astro build` with @astrojs/vercel while `process.version` starts with a major whose SUPPORTED_NODE_VERSIONS entry is `{status:'deprecated'}` — currently Node 18 (`18: {status:'deprecated'}` at line 98). Concretely: `node -v` shows v18.x and the Vercel adapter builds serverless output.

Common situations: Legacy projects pinned to Node 18 via `engines.node`, `.nvmrc`, or a Dockerfile; CI images (e.g. old GitHub Actions setup-node or a stale base image) still on Node 18; local machines that never moved off the Node 18 LTS line after Vercel deprecated it.

Related errors


AI-assisted analysis of withastro/astro@3578d45d34 (2026-08-18). Data as JSON: /api/errors/73239d38fb464494. Report an issue: GitHub.