facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
224.88k stars 45.86k forks source link

When I reload deployed reactjs app on any page other than main routes it says not found #26584

Closed GoPro9090 closed 1 year ago

GoPro9090 commented 1 year ago

React version: 18

Steps To Reproduce

  1. app is deployed on this head over it.
  2. change route to any other page from navbar reload the page it will produce the error

Link to code example:

The current behavior

render deployment says image netlify deployment image image

The expected behavior

muzamil301 commented 1 year ago

Could you please share a few details about the server On a few servers, we have to add .htaccess file with redirection rules for the case that if the user reloads the app it will recognize the route otherwise the app won't work

GoPro9090 commented 1 year ago

simple expressjs server with mongodb as database and mongoose ODM and deployed on render web service. haven't any file like .htacsess

Aaryansh1 commented 1 year ago

Hey @GoPro9090 I checked it out it seems to be working for me found no issues.

GoPro9090 commented 1 year ago

solved the issue actually the problem was that we have to add redirect/rewrite rules for reloading and refresh to work on render or any other problem.

thanks everyone for helping