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

Add CORS config to webpack_dev_server #99

Closed
leebenson opened this issue Oct 17, 2017 · 2 comments
Closed

Add CORS config to webpack_dev_server #99

leebenson opened this issue Oct 17, 2017 · 2 comments
Assignees

Comments

@leebenson
Copy link
Member

Currently, http://localhost:8080 won't hot-reload when a ReactQL project is bound to a non-localhost IP due to cross-origin restrictions. This makes it difficult to test over a LAN.

This needs adding to the Webpack dev config:

// Allow any origins, for use with Docker or alternate hosts, etc
headers: {
  'Access-Control-Allow-Origin': '*',
},
@hellojere
Copy link

I do get an access to the site like before, but I'm still getting blank images and no hot-reloading unfortunately.

I span up a fresh install from the latest kit where I can see the above lines as well, and changed the localhost to 0.0.0.0 on every dev environment related file.

@leebenson
Copy link
Member Author

You shouldn't need to change any files. Running this ought to work:

HOST=0.0.0.0 BROWSER_HOST=0.0.0.0 npm start

Make sure you're running the latest kit:

$ reactql version
4.9.2

If that's still not working, try the Docker version:

docker-compose -f docker-compose.dev.yml up

That should bind to localhost on whichever machine you're running it from. If you have Docker set-up to work across the network, you should also be able to access your Docker IP on port 8080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants