Current vs Expected Behavior
I’ve spent ~12 hours trying to get my Vite frontend and Express backend (monorepo) to deploy on Vercel. Every production deploy runs the Vite build (logs show build/index.html, build/assets/…), but the resulting deployment only contains the serverless lambda. vercel inspect shows two λ api/serverless/index.ts entries and zero static builds, so / always returns Vercel’s default 404 even though /api/apps works. I expect / to serve my SPA (frontend/build/index.html).
Code / Configuration / Repro Steps
-
Monorepo layout:
api/ (Express + Prisma serverless)
frontend/ (Vite SPA, `npm run build` → `frontend/build`)
vercel.json -
vercel.json:
{
"version": 2,
"builds": [
{ "src": "api/serverless/index.ts", "use": "@vercel/node" },
{
"src": "frontend/package.json",
"use": "@vercel/static-build",
"config": { "distDir": "build", "buildCommand": "npm run build" }
}
],
"routes": [
{ "src": "/api/(.*)", "dest": "api/serverless/index.ts" },
{ "handle": "filesystem" },
{ "src": "/(.*)", "dest": "/index.html" }
]
} -
frontend/package.json:
{
"scripts": {
"prebuild": "npm run sdk:gen",
"build": "vite build"
}
} -
Root directory in Vercel settings is blank and “Include files outside root” is disabled. Repo is connected via Git. Deploy command is vercel --prod --yes from a clean clone.
-
Build logs show Vite producing build/index.html, build/assets/index-*.js/css. No errors.
-
But vercel inspect https://aihomebrewapps-pn7kxu1gn-jason-stolworthys-projects-ecf26116.vercel.app (and every other deployment) shows only:
Builds:
┌ . [0ms]
├── λ api/serverless/index.ts (17.31MB) [iad1]
└── λ api/serverless/index.ts (17.31MB) [iad1]No static build, no index.html.
Project Info
-
Project: aihomebrewapps (project id prj_zjkJfhyzsdZznlKuolNGMeZm2b8j)
-
Frameworks: Express (serverless), Vite SPA
-
Environment: Production (vercel --prod --yes), Hobby account
-
Custom domain: www.aihomebrew.com
-
Deployment IDs with this issue: dpl_FVcBZSpcP6GPoShNDmN3Q6qNtuNy, dpl_EZt5hcz8PNrakytcfuP2N5R51bPp, dpl_FaykbUXTtuayVTtEq3PceJV9eHAG, dpl_FaykbUXTtuayVTtEq3PceJV9eHAG, dpl_2GV76JAF2wjHdpazSEQDTGYUkXLf, etc.
Why I’m Stuck
I’ve triple-checked vercel.json, rebuilt locally, toggled root-dir settings, re-linked, re-cloned, aliased multiple deployment URLs—everything. The Vite build runs but Vercel drops the output, so my domain will never serve the SPA. I’m losing it at this point. ![]()
Has anyone seen @vercel/static-build silently skip copying its output even though the build succeeds? I just need the static files to land in .vercel/output/static so the catch-all route works. Happy to share full logs or grant access. Any ideas appreciated!