dvdzkwsk / react-redux-starter-kit

Get started with React, Redux, and React-Router.
MIT License
10.29k stars 2.2k forks source link

Unable to use hashHistory with fractal structure #1297

Closed mayureshnw closed 7 years ago

mayureshnw commented 7 years ago

Hi, I did a build for my project and now I am trying to get it to run as a standalone file( not served ).

By standalone I mean expecting it to work with fileURL like file:///Users/username/project/dist/index.html.

This is not working, I get a blank page. The solution to this problem seems like using hashHistory instead of browserHistory.

I have tried replacing all borswerHistory to hashHistory but that doesnt seem to work. Please help me use hashHistory with this kit

mikedevita commented 7 years ago

I could be wrong (without testing it first) but this could have to do with the way most browsers handle file:/// URLs. Have you tried using something like http-server by running http-server dist/ and see if hashHistory works then?

Or is your use case required to serve up via file:///?

mayureshnw commented 7 years ago

My setup requires the files to be served via file:///

replacing browserHistory with hashHistory actually worked, but the problem was the since my public path was / , the js and css files were loaded as file://scqeefs4532334.js as opposed to file:///<path>/<hash>.js

This is solved. Solution: