stereobooster / react-snap

👻 Zero-configuration framework-agnostic static prerendering for SPAs
MIT License
5.06k stars 394 forks source link

React-Router relative paths not working #359

Closed Vrq closed 5 years ago

Vrq commented 5 years ago

Bug Report

Current Behavior Snapshots generated for relative paths like /about are not correct when using react-router

Reproducible demo

  1. Clone https://github.com/superhighfives/an-almost-static-stack,
  2. npm run build && serve -s build
  3. Open /about page, refresh and observe a blink (the response html file is the one from the root (/) page not the (/about) page

Caveat (reproduce point 3. by disabling browser cache in Chrome Devtools)

Expected behavior/code When /about page is refreshed I would expect the html of /about to be retrieved and no content flash

Possible Solution

Additional context/Screenshots Might it be that I am missing something or that serve command is incorrect? I spent some hours researching the issue but couldn't find anything.

stereobooster commented 5 years ago

reproducible example doesn't use react-snap, it use react-snapshot

https://github.com/superhighfives/an-almost-static-stack/blob/af9b20a428bc1860335e76bf6f9160584bee2a75/package.json#L9-L16