Deployment (Vercel)
Setup
- Connect the GitHub repo in Vercel.
- Build settings:
- Install:
npm install - Build:
npm run build - Output:
dist - Framework preset:
Astro - Node:
20.xin bothpackage.jsonand Vercel Project Settings
- Install:
- Git settings: set Production Branch =
main.
Environments
- Preview: auto-deployed for every PR.
- Production: deploys from
main. - Set env vars for both Preview and Production as needed.
Notes
vercel.jsoncurrently provides the repo’s response headers, including the/adminCMS policy.- The site builds as a static Astro app.
- The Decap admin UI can deploy on Vercel, but production editing still requires the GitHub-backed Decap auth flow to be configured separately.
Troubleshooting
- Check the Vercel build logs.
- Ensure Node =
20.xand env vars exist for the failing environment. - Warnings about deprecated
@hapi/*packages are currently transitive dependency noise, not repo-level package choices. - If Vercel warns about broad Node engines, pin the major version instead of using a floating range like
>=18. - Locally reproduce with
npm run typecheckfirst, thennpm run buildin an environment where Astro can spawn build workers.