Deploying Full-Stack React + Express.js: Debug Failure Error

I have a full-stack application with:

  • Frontend: React + Vite

  • Backend: Express.js server with LangChain and Warden Protocol integration

  • Structure: Both frontend and backend in same directory (examples/typescript/cli-agent/)

The application works locally with:

  • Frontend on localhost:5173

  • Backend API on localhost:3001

Current Configuration:


// vercel.json

{

"version": 2,

"builds": [

{

"src": "src/server/server.ts",

"use": "@vercel/node"

},

{

"src": "package.json",

"use": "@vercel/static-build",

"config": {

"distDir": "dist",

"buildCommand": "npm run build"

}

}

],

"routes": [

{

"src": "/api/(.*)",

"dest": "/src/server/server.ts"

},

{

"handle": "filesystem"

},

{

"src": "/(.*)",

"dest": "/index.html"

}

]

}

Issue:

When deploying to Vercel, I get:

  1. Error: Debug Failure during deployment
  • Project settings error suggesting to remove .vercel directory

Questions:

  • What’s causing the Debug Failure error?

  • How should I properly configure Vercel for a full-stack application with both frontend and serverless functions?

  • Is there a better way to structure this for Vercel deployment?

Any insights would be appreciated!

If you’re having trouble deploying an Express app, this guide can help.

You can also ask v0 for suggestions tailored to your own project setup.

Hi @juls95, welcome to the Vercel Community!

Thanks for reaching out in the community.

After reading your questions, I can highly recommend the following community post because it shares the recommendations when building a full-stack application on Vercel as well as the caveats and troubleshooting guide.

Feel free to drop more questions if you have after reading the post.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.