Skip to content

presets(vercel): add support for node@24 (v2) - #4628

Open
ps-20x wants to merge 1 commit into
nitrojs:v2from
ps-20x:fix/vercel-node24
Open

ps-20x wants to merge 1 commit into
nitrojs:v2from
ps-20x:fix/vercel-node24

Conversation

@ps-20x

@ps-20x ps-20x commented Sep 14, 2026

Copy link
Copy Markdown

🔗 Linked issue

#3965

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Backport of #3967 for v2.

-const SUPPORTED_NODE_VERSIONS = [18, 20, 22];
+const SUPPORTED_NODE_VERSIONS = [18, 20, 22, 24];

#3967 landed on main (v3) in January and was never backported, so v2 still caps the Vercel runtime at nodejs22.x. Since nuxt@4 depends on nitropack@^2, every Nuxt app on Vercel is affected, and the only stable release line that has the fix is v3 beta.

Why this is more than a cosmetic label. When the build container runs Node 24, SUPPORTED_NODE_VERSIONS.find((v) => v >= 24) matches nothing and falls through to ?? SUPPORTED_NODE_VERSIONS.at(-1), so .vc-config.json gets nodejs22.x. The build and the function then disagree about the Node version, which is silent until something in the bundle is ABI-sensitive.

We hit this in production on a Nuxt 4 site. Setting engines.node: "^24" made Vercel build on Node 24, which installed the ABI-137 prebuild of isolated-vm (a transitive native dep of @builder.io/sdk-vue), while nitro pinned the lambda to nodejs22.x:

Error: The module '/var/task/node_modules/isolated-vm/out/isolated_vm.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 137. This version of Node.js requires
NODE_MODULE_VERSION 127.

Every SSR and ISR route 500'd, since the ISR functions symlink to __fallback.func and inherit its config. The Vercel project's Node.js Version setting was already 24.x and had no effect — for Build Output API deployments the runtime comes from .vc-config.json.

nodejs24.x is the identifier Vercel itself uses; from @vercel/build-utils' NODE_VERSIONS table:

{ major: 24, range: "24.x", runtime: "nodejs24.x" }

Verified against nitropack@2.13.4 with a real NITRO_PRESET=vercel build: __fallback.func/.vc-config.json goes from "runtime": "nodejs22.x" to "runtime": "nodejs24.x" on Node 24, and is unchanged on Node 22.

Kept deliberately minimal and identical in shape to #396718 is left in place, and the runtime?: union in types.ts still omits nodejs24.x on both branches, so I left that alone rather than diverge from main. Happy to fold either in if you'd prefer.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly. — no docs change needed: docs/2.deploy/20.providers/vercel.md on v2 does not enumerate supported Node versions.

Backport of nitrojs#3967 for the v2 branch.

Vercel has supported nodejs24.x for builds and functions since it went
GA, and it is now the default for new projects. Without 24 in the list,
a build container running Node 24 matches no entry and falls through to
`.at(-1)`, so the emitted .vc-config.json pins the function to
nodejs22.x while the build installed Node 24 artifacts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ps-20x
ps-20x requested a review from pi0 as a code owner September 14, 2026 09:29
@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

@ps-20x is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 87d7d3b1-e03c-4246-8cd6-e9075171cd85

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pi0 pi0 added the v2 label Sep 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants