React-router urls don't work when refreshing or writing manually

My small project is live: https://git-space.netlify.app/
Repo: https://github.com/piyushsinha24/git-space

Landing page(https://git-space.netlify.app/) has a form which takes in username & shows github profile of that user with URL changed(for e.g https://git-space.netlify.app/user/piyushsinha24).

Everything is fine till here but if refresh this page or manually type this URL in a new tab then all I get is a white blank page.

I read some stack overflow solutions & they suggested to add a _redirects file inside the public folder with content /* /index.html 200. But still no luck.

Help me please.

hey there, this is likely relevant:

I already have a _redirects file with content mentioned above. I’m still stuck with the same issue.

I just removed “homepage” from my package.json & it somehow solved the issue. Works like charm.

1 Like