Routes not working on production
See original GitHub issueI’m having trouble finding the source of this issue since I’m not getting any errors even when I package the app with DEBUG_PROD=true. This works perfectly on development but here is how it looks on production:

I’ve had issues like this for a little while and couldn’t figure it out, today I updated to the latest version of the boilerplate and was able to fix a lot of them but I don’t even know how to start on this one. I thought there was something wrong with the history or store but everything is getting passed correctly so it seems fine.
I don’t think this is an issue with the boilerplate itself since it works with the counter example but maybe you can give me an idea to where I can start looking for the source of this issue.
Thank you very much for your time in advance!
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)

Top Related StackOverflow Question
@cdiezmoran your paths are updating as expected. You can see for yourself by logging
locationto the console when your app first loads, then navigate to the Dashboard and loglocationonce more.The issue you’re having is termed, update blocking, by React Router. React Router depends on the location object to determine what to render. In your case, the location object is updating as expected, but the React Router location-aware components are not re-rendering due to optimizations performed by React. The optimization that I believe is giving you trouble is
shouldComponentUpdate, which is used byreact-redux, was used byreact-apollo, and is used by a number of other 3rd party libraries. In short, yourAppcomponent is blocking updates.There are a few solutions available, but the quickest is to use React Router’s
withRouterHOC like so:That should take care of your issue. Also, I suggest you use
createHashHistoryin your production store. I noticed it resolved 2 bugs when I made that change. It resolved a window reload error, and the active menu item didn’t appear active on initial load otherwise.I recommend reading through update blocking if you need any further details as that documentation is well written.
Your app is super cool! 😄
I’d be happy to help @cdiezmoran. It would be helpful if I could dig into the code on my local device. Can you provide the commands for me to clone the repo and start the app?