Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

laymonage
Copy link
Contributor

Changes

Add support for Node 22 on Vercel serverless. Fixes #446.

I'm not sure if this is the approach you'd like. If we have a default value for status, and Vercel uses the latest available version as the default, it seems we should've used whatever marked as default as the... default. Right now the code uses Node 18 instead, which is not what the SUPPORTED_NODE_VERSIONS constant suggests.

I considered making Node 22 the default, but I'm worried that it might be considered a breaking change.

Testing

I haven't tested it yet, don't have the time to do it right now but it seems like these changes should be enough to add the support?

Docs

The docs say

The @astrojs/vercel adapter supports specific Node.js versions for deploying your Astro project on Vercel. To view the supported Node.js versions on Vercel, click on the settings tab for a project and scroll down to “Node.js Version” section.
Check out the Vercel documentation to learn more.

Vercel already supports Node 22 now, so the docs are currently misleading, and adding the support will correct it.

Copy link

changeset-bot bot commented Nov 26, 2024

🦋 Changeset detected

Latest commit: 8a476e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@astrojs/vercel Minor
@test/astro-vercel-basic Patch
@test/astro-vercel-function-per-route Patch
@test/astro-vercel-image Patch
@test/vercel-isr Patch
@test/vercel-max-duration Patch
@test/vercel-edge-middleware-with-edge-file Patch
@test/vercel-edge-middleware-without-edge-file Patch
@test/astro-vercel-no-output Patch
@test/astro-vercel-prerendered-error-pages Patch
@test/astro-vercel-redirects-serverless Patch
@test/astro-vercel-redirects Patch
@test/vercel-server-islands Patch
@test/astro-vercel-serverless-prerender Patch
@test/astro-vercel-serverless-with-dynamic-routes Patch
@test/astro-vercel-static-assets Patch
@test/astro-vercel-static Patch
@test/vercel-streaming Patch
@test/astro-vercel-with-speed-insights-enabled-output-as-server Patch
@test/astro-vercel-with-speed-insights-enabled-output-as-static Patch
@test/astro-vercel-with-web-analytics-enabled-output-as-static Patch
vercel-hosted-astro-project Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: vercel Related to Vercel adapter (scope) label Nov 26, 2024
@ematipico
Copy link
Member

We can't make v22 the default because Astro itself doesn't officially support it.

@bluwy
Copy link
Member

bluwy commented Nov 27, 2024

Doesn't out node version range allow node 22? https://github.com/withastro/astro/blob/cf0d8b08a0f16bba7310d1a92c82b5a276682e8c/packages/astro/package.json#L229 which technically means we support it. And it's also the active LTS now.

@ematipico
Copy link
Member

Yeah, sorry, I misunderstood for Node.js v23 😓

@ematipico
Copy link
Member

@bluwy should we point this PR against next? What do you think?

@bluwy
Copy link
Member

bluwy commented Nov 27, 2024

I think it's fine in a minor, but our next major release is also not far away so that's fine by me too if you prefer to do so 👍

@ematipico ematipico merged commit 7d9835f into withastro:main Nov 28, 2024
8 checks passed
@github-actions github-actions bot mentioned this pull request Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: vercel Related to Vercel adapter (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node 22 unsupported in vercel serverless adapter
3 participants