Skip to content

Add Vercel SPA routing config to fix 404 on direct navigation#557

Merged
bfirsh merged 1 commit intomainfrom
bfirsh/fix-vercel-spa-routing
Feb 15, 2026
Merged

Add Vercel SPA routing config to fix 404 on direct navigation#557
bfirsh merged 1 commit intomainfrom
bfirsh/fix-vercel-spa-routing

Conversation

@bfirsh
Copy link
Owner

@bfirsh bfirsh commented Feb 15, 2026

Summary

Direct navigation to routes like /run/accuracycoin returned 404 on Vercel because the deployment platform looked for matching files on disk instead of serving the SPA index.html. This adds a Vercel configuration file with a rewrite rule that matches the existing Netlify _redirects setup, enabling React Router to handle all routes client-side.

Test plan

  • Deploy to Vercel
  • Navigate directly to a ROM URL like /run/accuracycoin
  • Verify the page loads instead of showing 404

🤖 Generated with Claude Code

Vercel returns 404 when navigating directly to routes like /run/:slug
because it looks for a matching file on disk. This rewrite rule tells
Vercel to serve index.html for all routes, letting React Router handle
client-side routing. Equivalent to the existing Netlify _redirects file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bfirsh bfirsh merged commit cfffc50 into main Feb 15, 2026
5 checks passed
@bfirsh bfirsh deleted the bfirsh/fix-vercel-spa-routing branch February 15, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant