DEV Community

USMAN
USMAN

Posted on

Blank page on production build

I have built a simple react app using create-react-app and react-router-dom@6

And this happens only when i use BrowserRouter, HashRouter and MemoryRouter work just fine.

Please guide me how to build production app using BrowserRouter keeping in mind i will deploying it on linux server(hostinger.in) and in a subdirectory domain.com/react-app(!if .htaccess is required)

Few things i tried

  1. Adding "homepage" : "./" or "homepage" : "." in package.json
  2. Many .htaccess codes :')

You can see the hosted app Here

Top comments (1)

Collapse
 
jagdishlove profile image
Jagdish Singh Mehra

Try to add .env file in ur root dir and add PUBLIC_URL="URL"