React-snap: Routing broken on page refresh

Created on 13 Aug 2019  路  5Comments  路  Source: stereobooster/react-snap

Bug Report

[email protected]

Current Behavior
(Using react-router-4) When I navigate to a route other than /, for example, /about, and refresh the browser, the static site seems to mount components for / while also mounting things for the route component

Reproducible demo
https://github.com/creativelifeform/nebula-web/tree/feature/react-snap

Expected behavior/code
It should render the route and route component correctly

Possible Solution
N/A

Additional context/Screenshots
On navigate to route:

Screen Shot 2019-08-14 at 7 21 53 am

On refresh route:
Screen Shot 2019-08-14 at 7 22 02 am

Most helpful comment

Interesting, do you have any idea what specific thing is causing this? Missing a trailing slash or something? It would be good to know whether I need to implement a specific nginx config in prod as I'm getting a similar issue there.

All 5 comments

how is your server configured?

Happens locally using the default server suggested by CRA

the problem is in the server try this instead

npm run build
npx http-server -p 8000 build

Interesting, do you have any idea what specific thing is causing this? Missing a trailing slash or something? It would be good to know whether I need to implement a specific nginx config in prod as I'm getting a similar issue there.

@rohan-deshpande did u figure out how to configure the server? this is happening also to me on aws s3 hosted site

Was this page helpful?
0 / 5 - 0 ratings

Related issues

goras picture goras  路  5Comments

aheissenberger picture aheissenberger  路  7Comments

jessevdp picture jessevdp  路  8Comments

philipeatela picture philipeatela  路  3Comments

stereobooster picture stereobooster  路  6Comments