Fix DApp Vercel Deployment
Issue
The build was failing because Vercel runs from packages/dapp directory, but the workspace command needs to run from the repo root.
Solution
Option 1: Configure in Vercel Dashboard (Recommended)
- Go to your Vercel project: https://vercel.com/kcolbchains-projects/dapp/settings
- Go to Settings → General
- Set Root Directory to:
.(repo root) - The
vercel.jsonwill then work with:json{ "buildCommand": "npm run build --workspace=packages/dapp", "outputDirectory": "packages/dapp/.next", "framework": "nextjs" }
Option 2: Use Updated vercel.json (Current)
The current vercel.json uses:
json
{
"buildCommand": "cd ../.. && npm run build --workspace=packages/dapp",
"outputDirectory": ".next",
"framework": "nextjs"
}This works when Root Directory is set to packages/dapp (default when linking from that directory).
Environment Variables
All environment variables are already set:
- ✅ NEXT_PUBLIC_CHAIN_ID
- ✅ NEXT_PUBLIC_CR8_TOKEN_ADDRESS
- ✅ NEXT_PUBLIC_CR8_STAKING_ADDRESS
- ✅ NEXT_PUBLIC_TOKEN_VESTING_ADDRESS
- ✅ NEXT_PUBLIC_AGENT_DEPOSIT_ADDRESS
- ⚠️ NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID (needs to be added)
Next Steps
Add WalletConnect Project ID:
bashcd packages/dapp vercel env add NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID production # Enter your WalletConnect Project ID when promptedDeploy:
bashcd packages/dapp vercel --prodOr push to GitHub and let Vercel auto-deploy.