Working together with a backend on a different port?
See original GitHub issueNot sure if I’m messing up something with the configuration, or my usecase is not suitable for react-hot-loader. So I have an application that runs on python (Flask), on localhost:5000. I followed the guide on http://gaearon.github.io/react-hot-loader/getstarted/, how to configure react-hot-loader for automatic reloading, and it almost works. The js files get bundled up, they are being watched for changes, and the browser gets notified about changes, however it sends an ajax request to an incorrect url:
http://127.0.0.1:5000/6495ade23756374f56fd.hot-update.json
Note the port number, this will be handled by Flask, which will result in a 404.
So to clarify:
My python backend is running on localhost:5000 Webpack server is running on 3000 (as per the tutorial) I’m loading the JS bundle with:
<script type="text/javascript" src="http://localhost:3000/bundle.js"></script>
When I initially open my application in the browser (by going to http://localhost:5000), I see this in the firebug console:
GET http://0.0.0.0:3000/socket.io/1/?t=1425134048889 200 OK 1ms bundle.js (line 2381)
[HMR] Waiting for update signal from WDS... bundle.js (line 706)
[WDS] Hot Module Replacement enabled.
(which is good!)
But when I change a file, this gets logged in the firebug console:
[WDS] App updated. Recompiling... bundle.js (line 572)
[WDS] App hot update... bundle.js (line 614)
[HMR] Checking for updates on the server... bundle.js (line 701)
GET http://127.0.0.1:5000/f450e336c3b076f73ab0.hot-update.json 404 NOT FOUND 2ms bundle.js (line 26)
"NetworkError: 404 NOT FOUND - http://127.0.0.1:5000/f450e336c3b076f73ab0.hot-update.json"
f450e33...te.json
[HMR] Cannot find update. Need to do a full reload! bundle.js (line 644)
[HMR] (Probably because of restarting the webpack-dev-server)
For some reason it sent a request to :5000 for the hot-update.json, instead of :3000.
Did I miss something when configuring webpack? Or do I have to proxy requests to the webpack server from my application server?
Issue Analytics
- State:
- Created 9 years ago
- Reactions:16
- Comments:17 (4 by maintainers)

Top Related StackOverflow Question
in this issues https://github.com/gaearon/react-hot-loader/issues/194 @seburgi suggest adding " publicPath: ‘/’ " to output section, so it looks like this:
That help me fixed the problem.
@AlexLeung I have it set to
http://localhost:3000/and it works for me