Fork me on GitHub
#reitit
<
2023-12-13
>
stagmoose06:12:36

i have a pure frontend webpage that use reitit.frontend to do the routing. if i start from the root page (index.html) and click a link /xxx i can be brought to http://localhost:8080/xxx . if i refresh, i can still see the correct content. why does this work? my app.js is put in the <head> of index.html, so it should not be loaded when i directly visit http://localhost:8080/xxx ? if i put my index.html and my app.js to vercel.app. i can go to mysite.vercel.app and then mysite.vercel.app/xxx from that page. but if i refresh from mysite.vercel.app/ , i will have a 404 error. any idea why refreshing from /xxx in localhost works while hosting on web doesn't. thanks for your help~

stagmoose07:12:48

turns out this is related to vercel itself not reitit: https://stackoverflow.com/questions/64815012/why-does-react-router-not-works-at-vercel can solve the issue