- Keep the root
package.jsonI just created - Use the current
vercel.jsonconfiguration - In Vercel Dashboard Settings:
- Root Directory: Leave empty (use root)
- Build Command:
npm run build - Output Directory:
client/dist - Install Command:
npm install
- Delete root
package.json - In Vercel Dashboard Settings:
- Root Directory:
client - Build Command:
npm run build - Output Directory:
dist - Install Command:
npm install
- Root Directory:
- Rename
vercel-alternative.jsontovercel.json - Use the alternative configuration
- Go to your project settings
- Go to "Build & Development Settings"
- Set these values:
Framework Preset: Vite Root Directory: client Build Command: npm run build Output Directory: dist Install Command: npm install
VITE_API_URL=https://syncruncode.onrender.com
VITE_SOCKET_URL=https://syncruncode.onrender.com
- Fix: Set Root Directory to
clientin Vercel dashboard - Or: Use root
package.jsonwith workspace setup
- Fix: Ensure
client/distexists after build - Check: Build works locally with
cd client && npm run build
- Fix: Set variables in Vercel dashboard, not just in vercel.json
- Verify: Variables start with
VITE_
- Local Test:
cd client && npm run build - Check Output: Ensure
client/distfolder is created - Deploy: Push to GitHub and check Vercel logs
- Debug: Check Vercel build logs for specific errors
package.json(root) - Workspace configurationvercel.json- Main configurationvercel-alternative.json- Alternative configurationvercel-simple.json- Simple configuration