Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble embedding it in Flask app #59

Closed
aitchnyu opened this issue Apr 9, 2016 · 1 comment
Closed

Trouble embedding it in Flask app #59

aitchnyu opened this issue Apr 9, 2016 · 1 comment

Comments

@aitchnyu
Copy link

aitchnyu commented Apr 9, 2016

I want the compiled app within my Flask (Python web framework) app which serves at port 5000. So I embedded the bundle within Flask template like:

<script src="http://localhost:3000/static/bundle.js"></script>`

I then load my app at localhost:5000 and it loads fine, all but the last request are successful. The last request is triggered by a code change and it fails since the request goes to port 5000.

Request URL:http://localhost:5000/

Request URL:http://localhost:3000/static/bundle.js

Request URL:http://localhost:3000/sockjs-node/info?t=1460205226170

Request URL:ws://localhost:3000/sockjs-node/388/o2owupos/websocket

Request` URL:http://localhost:5000/static/3d78a8f83264d3f603be.hot-update.json

Webpack generates following when I edit code:

Hash: be0f4b289250fb4f2536
Version: webpack 1.12.14
Time: 309ms
                               Asset      Size  Chunks             Chunk Names
                           bundle.js   1.01 MB       0  [emitted]  main
0.3d78a8f83264d3f603be.hot-update.js   3.73 kB       0  [emitted]  main
3d78a8f83264d3f603be.hot-update.json  36 bytes          [emitted]  
chunk    {0} bundle.js, 0.3d78a8f83264d3f603be.hot-update.js (main) 875 kB [rendered]

Please fix the request webpack makes to .hot-update.json too. All other requests are correct.

Sorry if this was the wrong place for raising this concern. I asked here as most people copy this repo for their react boilerplates. I look forward to be using your awesome work!

@gaearon
Copy link
Owner

gaearon commented Apr 17, 2016

Please put publicPath: 'http://localhost:3000/static/' in your Webpack config.

@gaearon gaearon closed this as completed Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants