I have a mock shop React application with a few different routes which works as expected on localhost. When deployed (both on Surge and Render) the subdirectories/links do not work.
My 404 page does not load too.
The funny bit is when I access an item details page from the link in the app it loads ok. When I paste the very same url into a different tab or even refresh the current one, I get 404 again. I noticed that the actual http request in the second instance is not sent to my back end (vinyl-shop.onrender.com) but to the front end app (vinylarium.onrender.com):
The “good” request to my back end:
Request from the same url being sent to the front end instead after request is resent with refresh/F5
I have the same problem with /orders page where users are supposed to be seeing their order history, with /admin and basically with the whole app.
The app is deployed here and here. You can log in as [email protected] with password “1234” to test it yourself.
I can paste some code of course but think the problem is more conceptual than technical.
The whole app code could be found here anyway.
It goes without saying that locally everything works fine.
Any help will be greatly appreciated.