stereobooster / react-snap

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

Prerendering not working on localhost but works on online service such as Netlify #412

Open FatehAK opened 4 years ago

FatehAK commented 4 years ago

Bug Report

Current Behavior I am trying to serve the application on localhost using serve -s build it works fine. But when I disable JavaScript the routes are not working and I only get the '/' route's index.html in the response even when I navigate to other routes. The odd thing about this is when I deploy the app to Netlify it works perfectly fine even with JavaScript disabled. Can you look into it I am practicing prerendering with your package.

On another note I also get this error for each route when I run the postbuild react-snap command :

�  console.log at /contact: Failed to load resource: net::ERR_INVALID_ARGUMENT
️️️�  console.log at /contact: Failed to load resource: net::ERR_INVALID_ARGUMENT

Reproducible demo Link to GitHub repository or codesandbox with a demo of the bug behavior. https://github.com/FatehAK/React-Prerendering

Expected behavior/code Expect prerendering to work on localhost with JS disabled.