Hi everyone, I’ve been deploying a React + Vite frontend on Vercel and an Express + Stripe backend on Render. Everything works — Stripe creates sessions, webhooks are delivered, payments are processed — but after completing or canceling a Stripe Checkout, Stripe fails to redirect to my frontend URLs and throws this error instead: 404: NOT_FOUND Code: DEPLOYMENT_NOT_FOUND ID: sfo1::xxxxx-xxxxxxxxxxxx The checkout itself works perfectly (payment captured, event logged in Stripe dashboard), but instead of loading the /success or /cancel React pages, I get that Vercel 404 page. ⚙️ Setup Frontend: Framework: React + Vite Hosted on: Vercel Domain: https://mohhikat-clean.vercel.app Secondary domain (auto-generated by Vercel): https://mohhikat-clean-alejandros-projects-12a5fac1.vercel.app Routes managed with React Router Backend: Express server running on Render URL: https://mohhikat-api.onrender.com Uses Stripe Checkout (session mode: “payment”) Checkout session creation (index.js): const session = await stripe.checkout.sessions.create({ payment_method_types: ["card"], line_items: lineItems, mode: "payment", success_url: "https://mohhikat-clean.vercel.app/success",
cancel_url: "https://mohhikat-clean.vercel.app/cancel", }); 🧱 What works ✅ Checkout sessions open correctly ✅ Payments succeed and appear in Stripe dashboard ✅ Webhooks delivered successfully to Render (/webhook) ✅ Render logs show successful POST events ✅ Backend endpoint tested manually (returns 200 OK) ❌ What fails When Stripe tries to redirect back to the frontend (either /success or /cancel), Vercel responds with the error: 404: NOT_FOUND Code: DEPLOYMENT_NOT_FOUND ID: sfo1::xxxxx-xxxxxxx Visiting /success or /cancel manually in the browser also returns that same 404 error, even though these routes exist in the React app (} />). I’ve already tried: Adding "src": "/(.*)", "dest": "/index.html" in vercel.json Removing builds / changing outputDirectory Disabling automatic Git deployments Redeploying both frontend and backend Setting success_url and cancel_url explicitly to the main domain None of these fixed it. 🔍 Additional info The error only happens in production on Vercel. Locally (npm run dev + Stripe CLI) works perfectly. The app uses React Router (BrowserRouter). The 404 page looks like Vercel’s internal “deployment not found”, not my app’s NotFound component — so it never even reaches React. 💡 What I suspect Vercel might be redirecting Stripe’s return URL to a preview/temporary deployment domain instead of the main one. However, I’ve locked my repo to production (main branch only) and disabled previews, yet it still happens. Alternatively, Vercel might not be serving /success or /cancel correctly because of some internal routing issue or missing rewrite rule. 🧾 Question What’s the definitive way to configure Vercel so that: /success and /cancel are handled by React Router (no 404 from Vercel), Stripe’s redirection URLs always resolve to the production deployment (mohhikat-clean.vercel.app), and Vercel stops returning “Deployment not found” for those routes? Any working example of a Stripe + React + Vercel integration (with routes like /success) would also help a lot. 📎 References for helpers Frontend repo: React + Vite + React Router Backend: Express.js with Stripe v15+ Hosting: Frontend (Vercel), Backend (Render) Stripe mode: Live Webhook URL: https://mohhikat-api.onrender.com/webhook 🗣️ TL;DR Stripe checkout works fine, but on redirect, Vercel gives: 404 NOT_FOUND — Deployment not found Frontend uses React Router. /success and /cancel routes exist. Need a permanent fix so Stripe redirect loads the actual app page and not a missing deployment.
