mhaagens / react-mobx-react-router4-boilerplate

React, React-Router 4, MobX and Webpack 2-boilerplate with async routes.
560 stars 137 forks source link

routes not loading in preview #40

Closed juxta52 closed 7 years ago

juxta52 commented 7 years ago

In a production deployment... I ran npm run build, then npm run preview. I'm able to get to the site hosted at port 1234 (default ootb configuration in package.json). I'm able to navigate and go through posts and view an individual posts. But if I were to copy and paste that URL to a different browser, going to that page gives me a 404 not found. If I ran the project with npm run start I can use that same copied and pasted URL, and it would resolve to the proper post.

Is this a flaw with http-server or react-router? Or could it be the npm run build script and how the production code is being built? How would you recommend a local deployment of the production build that would allow for copied and pasted urls to work?

BTW, thanks for sharing the boilerplate, it was a great introduction to Mobx!

brunon80 commented 7 years ago

I have the same issue....

bllfrnch commented 7 years ago

+1

mhaagens commented 7 years ago

Fixed in the latest commit. http-server doesn't handle HTML5 pushState, so switched it out for pushstate-server.