Skip to content

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

  1. Go to your Vercel project: https://vercel.com/kcolbchains-projects/dapp/settings
  2. Go to SettingsGeneral
  3. Set Root Directory to: . (repo root)
  4. The vercel.json will 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

  1. Add WalletConnect Project ID:

    bash
    cd packages/dapp
    vercel env add NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID production
    # Enter your WalletConnect Project ID when prompted
  2. Deploy:

    bash
    cd packages/dapp
    vercel --prod

    Or push to GitHub and let Vercel auto-deploy.

CR8 Platform Documentation