Skip to content

Fix SPA routing on Vercel#29

Merged
msaps merged 1 commit into
mainfrom
fix/vercel-spa-routing
May 22, 2026
Merged

Fix SPA routing on Vercel#29
msaps merged 1 commit into
mainfrom
fix/vercel-spa-routing

Conversation

@msaps
Copy link
Copy Markdown
Member

@msaps msaps commented May 22, 2026

Summary

  • Adds vercel.json with a catch-all rewrite rule so all routes are served index.html
  • Fixes direct URL navigation returning 404 for routes like /preview and /privacy

Root cause

Vercel serves the built SPA as static files. Without a rewrite rule, direct requests to /preview look for a physical file that doesn't exist, returning 404. Client-side link clicks work because React Router handles them without a server round-trip.

🤖 Generated with Claude Code

Without this, direct URL access to any route (e.g. /preview, /privacy)
returns a 404 from Vercel's CDN. The rewrite ensures all requests are
served index.html so React Router can handle client-side routing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
loungebird Ready Ready Preview, Comment May 22, 2026 12:31pm

@msaps msaps enabled auto-merge (squash) May 22, 2026 12:30
@msaps msaps merged commit da14317 into main May 22, 2026
3 checks passed
@msaps msaps deleted the fix/vercel-spa-routing branch May 22, 2026 12:31
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