New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routing not working when running app with Production Config #1853
Comments
I've found the issue. For anyone else facing the same problem, Replace According to react-router docs, you should |
This is less a solution and more of a workaround. You'd need to tell your server to "handle all other routes" with the correct path. With express, you would set a route |
i am experiencing same issue here. @vikr01 could you please explain how to to that? |
My understanding was the same regarding HashRouter. This is my entrypoint code
And this is my Switch-Route setup
Warning I get:
|
Nothing worked. I looked at like 10 different answers for this. Eventually figured this out through trial and error, works in both dev and prod:
I wrote an SO answer with more details: https://stackoverflow.com/a/63441289/1884363 |
Opening a new window with specifc page is redirecting back to index route. This behavior is only happening when running the application with
npm run start
. Routes are working properly when running the application withnum run dev
.Routes are setup as below.
The text was updated successfully, but these errors were encountered: