Skip to content

Fix production 404: remove custom catch-all rewrite in vercel.json - #4

Merged
akivayevdayev-debug merged 2 commits into
mainfrom
fix/vercel-404-routing
Aug 16, 2026
Merged

Fix production 404: remove custom catch-all rewrite in vercel.json#4
akivayevdayev-debug merged 2 commits into
mainfrom
fix/vercel-404-routing

Conversation

@akivayevdayev-debug

Copy link
Copy Markdown
Owner

Summary

  • Production has been returning 404 for every route except static/, favicon.ico, manifest.webmanifest, and service-worker.js (the paths excluded from the custom rewrite).
  • Vercel runtime logs show the WSGI/ASGI app receiving the literal path /api/index for every rewritten request instead of the real requested path, so neither FastAPI's nor Flask's router ever matches.
  • The excluded paths already reach api/index.py correctly via Vercel's implicit default routing (path preserved) — proving the custom rewrites rule itself was the cause, not app code.
  • Removing the custom rewrite lets Vercel's already-working implicit routing handle every path.

Verification

  • Built and confirmed on a real preview deployment (this branch): GET / returned 200 with the actual rendered app HTML, and the deployment's own runtime log shows "GET / HTTP/1.1" 200 -" (previously "GET /api/index HTTP/1.1" 404 -" for the same path on production).
  • Static asset routes (already working pre-fix, since the removed rule never applied to them) are untouched by this change.

Test plan

  • Preview deployment built successfully
  • GET / on preview returns 200 with real app HTML (verified via runtime logs and an authenticated fetch)
  • After merge, confirm production GET /, /ask, /api/daily-study return 200 (not 404) and static asset routes are unaffected

🤖 Generated with Claude Code

Every non-excluded path (/, /ask, /api/*, etc.) has been 404ing in
production. Runtime logs show the WSGI/ASGI app receiving the literal
path "/api/index" for every one of these requests, instead of the
actual requested path -- so neither FastAPI's nor Flask's router ever
matches, and everything 404s.

Paths excluded from the rewrite's negative-lookahead (static/,
favicon.ico, manifest.webmanifest, service-worker.js) are unaffected
and correctly reach api/index.py with their real path intact via
Vercel's implicit default routing to the sole configured function --
proving the rewrite itself, not the app code, is what's collapsing
the path to its literal destination string.

Removing the custom rewrite lets that already-working implicit
routing handle every path, matching the exact behavior already
proven correct for the excluded paths above.
@supabase

supabase Bot commented Aug 15, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project tfijjjetoxehnghlvtxm because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
shelah_app Ready Ready Preview Aug 16, 2026 5:31pm

@sonarqubecloud

Copy link
Copy Markdown

@akivayevdayev-debug
akivayevdayev-debug merged commit 860cafc into main Aug 16, 2026
6 checks passed
@akivayevdayev-debug
akivayevdayev-debug deleted the fix/vercel-404-routing branch August 16, 2026 17:34
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