Skip to content

DApp Vercel Deployment Setup

Important: Root Directory Configuration

For the DApp to deploy correctly on Vercel, you must configure the Root Directory in the Vercel dashboard.

Step-by-Step Setup

1. Go to Vercel Project Settings

  1. Visit: https://vercel.com/kcolbchains-projects/dapp/settings
  2. Click on SettingsGeneral

2. Set Root Directory

  • Find Root Directory setting
  • Click Edit
  • Set to: . (repo root) or leave empty
  • Click Save

3. Verify Build Settings

The vercel.json is configured as:

json
{
  "buildCommand": "npm run build --workspace=packages/dapp",
  "outputDirectory": "packages/dapp/.next",
  "framework": "nextjs"
}

This assumes Vercel runs from the repo root, not from packages/dapp.

4. Environment Variables

All required environment variables are already set:

  • NEXT_PUBLIC_CHAIN_ID=11155111
  • NEXT_PUBLIC_CR8_TOKEN_ADDRESS=0xE808092649524be59337815D57cd2CFa457E2263
  • NEXT_PUBLIC_CR8_STAKING_ADDRESS=0x64352520ac1F83f1447cF72E42819010D2359537
  • NEXT_PUBLIC_TOKEN_VESTING_ADDRESS=0xCCcadaD8Bd3C32811e3dd194128d4E3A90e2f315
  • NEXT_PUBLIC_AGENT_DEPOSIT_ADDRESS=0xB3E801EAce32f616c67B0Ac29Cd0eb1677587C28
  • ⚠️ NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID (add this if you have one)

5. Deploy

After setting Root Directory to .:

Option A: Auto-deploy via GitHub

  • Push to main branch
  • Vercel will automatically deploy

Option B: Manual deploy via CLI

bash
cd packages/dapp
vercel --prod

Why Root Directory Matters

  • If Root Directory = packages/dapp: Vercel runs npm install and build from that directory, but workspace commands won't work
  • If Root Directory = . (repo root): Vercel runs from repo root, workspace commands work correctly

Troubleshooting

Error: "No workspaces found"

  • Fix: Set Root Directory to . in Vercel dashboard

Error: "Could not read package.json"

  • Fix: Make sure Root Directory is set to . (repo root), not packages/dapp

Build succeeds but app doesn't work

  • Check environment variables are set for Production environment
  • Verify contract addresses are correct for Sepolia testnet

Current Status

✅ Project linked to Vercel
✅ Environment variables configured
⚠️ Root Directory needs to be set to . in dashboard
⏳ Waiting for deployment after Root Directory is set

CR8 Platform Documentation