I tried to deploy my app to Vercel (create-react-app starter). It was deploy successful, no errors in console or my vercel account. But when i clicked a link, i have this message:
404: NOT_FOUND Code: NOT_FOUND ID: ...
How to fix that? I have React (hooks, router) and Redux store, no database, no next.js. Thank you!
i fixed this issue just now. turns out that only 1 route works, the "/" home route and other routes work for a short time, when you refresh the page, it shows a 404 page. it only happens if you don't configure your vercel.json
. The routes don't get recognized except the "/" Home page route.
follow these steps:
vercel.json
file. Then add these lines{ "rewrites": [{ "source": "/(.*)", "destination": "/" }] }
I really hope it helps anyone on the internet
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With