Skip to content

Issues with deployment on vercel platform #212

Open
@finfin

Description

@finfin

There are two issues when I try to deploy on vercel,

  1. Vercel defaults to node v22, but serverless function did not support v22, need to change the node version.
[17:13:25.719] 09:13:25 [build] Rearranging server assets...
[17:13:25.731] 09:13:25 [@astrojs/sitemap] `sitemap-index.xml` created at `.vercel/output/static`
[17:13:25.731] 09:13:25 [WARN] [@astrojs/vercel/serverless] 
[17:13:25.732] 	The local Node.js version (22) is not supported by Vercel Serverless Functions.
[17:13:25.732] 	Your project will use Node.js 18 as the runtime instead.
[17:13:25.732] 	Consider switching your local version to 18.
[17:13:25.732] 
[17:13:25.732] 09:13:25 [@astrojs/vercel/serverless] Bundling function ../../_functions/entry.mjs
[17:13:28.772] 09:13:28 [build] Waiting for integration "@astrojs/vercel/serverless", hook "astro:build:done"...
[17:13:29.792] 09:13:29 [build] Server built in 15.24s
[17:13:29.792] 09:13:29 [build] Complete!
[17:13:29.845] Done in 30.38s.
[17:13:48.666] Build Completed in /vercel/output [2m]
[17:13:49.332] Deploying outputs...
[17:13:49.670] Error: The following Serverless Functions contain an invalid "runtime":
[17:13:49.672]   - _render (nodejs18.x). Learn More: https://vercel.com/guides/serverless-function-contains-invalid-runtime-error
[17:13:50.150] 

solution: add following to package.json will solve this error, reference

"engines": {
    "node": "22.x"
  }
  1. Vercel hobby(free) plan only supports up to 12 serverless function, which will show following errors
[17:06:33.644] Deploying outputs...
[17:06:49.568] Error: No more than 12 Serverless Functions can be added to a Deployment on the Hobby plan. Create a team (Pro plan) to deploy more. Learn More: https://vercel.link/function-count-limit
[17:06:50.160] 

possible solution: add some note in readme

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions