React Router works locally but 404s on Vercel when I refresh #14292
-
I deployed my React app to Vercel using react-router, and routing works when I click around the app. |
Beta Was this translation helpful? Give feedback.
Answered by
sameersharmadev
Sep 5, 2025
Replies: 1 comment
-
This is not an issue with react router, its because Vercel does not support client side rendering out of the box. {
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
themintytoast
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not an issue with react router, its because Vercel does not support client side rendering out of the box.
Simplest fix is to just serve index.html on each route by adding
vercel.json
in your root directory with: