T
TanStack11mo ago
rare-sapphire

Access routes other than route leads to cannot get route

Hi, I have my file-based routes like this the screenshot If I try navigating from root to /raffle-details/$id, or reload that page, it'd work normally in dev server (vite). The issue happens with the build. I ran live-server and it was able to open the root route, then the details route. But if I access the details route directly, or reload that page, I'll get Cannot get page (screenshot). I try adding a notFoundComponent, it was not able to load this component as well. Any ideas? Thank you in advance!
No description
No description
No description
2 Replies
foreign-sapphire
foreign-sapphire11mo ago
probably you need to correctly configure your server to serve the index.html regardless which path is requested
rare-sapphire
rare-sapphireOP11mo ago
indeed, I resolved it by either redirecting all requests to index.html, or using createHashHistory. thank you!

Did you find this page helpful?