I found a work around, not sure how good or desirable it is. Other than what I did, I believe that another fix would require to reorganize the app structure or how the useEffects load...
I cannot explain why, but it looks like in order to have the universalContext loaded as well as the session, we need to lbe sure the Home page is loaded.
So for cases like the issue, I added a redirection that would make the home page load in the background even if we access http://localhost:3000/upcomingElections directly from the browser.
The issue was different than https://dev.to/rajeshroyal/page-not-found-error-on-netlify-reactjs-react-router-solved-43oa
I found a work around, not sure how good or desirable it is. Other than what I did, I believe that another fix would require to reorganize the app structure or how the useEffects load... I cannot explain why, but it looks like in order to have the universalContext loaded as well as the session, we need to lbe sure the Home page is loaded. So for cases like the issue, I added a redirection that would make the home page load in the background even if we access http://localhost:3000/upcomingElections directly from the browser.