Skip to content

Clamp to valid Vercel Node versions #2819

Closed

Description

@cjpearson

Describe the feature

The Vercel preset currently sets its runtime node version based on the version of node used to build the application. https://github.com/unjs/nitro/blob/v2/src/presets/vercel/utils.ts#L19 This caused an issue when updating from Node 20 to 22 (the LTS recently changed) because Vercel does not support Node 22.

What do you think about clamping the value to valid versions? So if you build with v22 or v23, v20 will be used as the default for the runtime?

Alternatively, maybe follow the same rules as Vercel does with the engine field? I was originally a bit confused with the invalid runtime error because I assumed those rules would apply (and we have >= 20 in our engines), but Nitro setting the runtime takes precedence.

Additional information

  • Would you be willing to help implement this feature?

Activity

  1. added
    pending triage
    on Oct 29, 2024
  2. added
    enhancement
    and removed
    pending triage
    on Oct 30, 2024
  3. pi0x commented on Sep 7, 2026

    @pi0x
    Contributor

    Fixed in v3 — the Vercel runtime is now clamped to the versions Vercel actually supports and can be overridden with vercel.functions.runtime, see https://github.com/nitrojs/nitro/blob/main/src/presets/vercel/utils.ts.

    Triaged with AI assistance.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpreset:vercel

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions