Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Can't access webpack-dev-server :8080 from Vagrant #27

Closed
joeframbach opened this issue Apr 18, 2015 · 4 comments
Closed

Can't access webpack-dev-server :8080 from Vagrant #27

joeframbach opened this issue Apr 18, 2015 · 4 comments

Comments

@joeframbach
Copy link
Contributor

Steps:

  1. vagrant init "ubuntu/trusty64".
  2. Modify Vagrantfile to add port 8000 and 8080 to be accessible by host.
  3. vagrant up
  4. vagrant ssh
  5. git clone github...react-isomorphic-starterkit, cd, npm install -g, npm install
  6. Instead of npm run watch, which will fail because there is no browser/VT available, run:
    • npm run watch-client # in one tab
    • npm run start # in another tab

Result: http://localhost:8000/ looks great and shows the static result correctly, but throws a 404 on http://localhost:8080/dist/client.js

Problem: http://localhost:8080/dist/client.js can't be found by the host. If I instead run python -m SimpleHTTPServer 8080 or http-server -p8080, then http://localhost:8080/dist/client.js is found. It just looks like webpack-dev-server isn't listening to requests from the host?

@joeframbach
Copy link
Contributor Author

Solved!

I added host: "0.0.0.0" to the config.devServer config in webpack.client-watch.js.

@Jakobud
Copy link

Jakobud commented Nov 21, 2015

I have the same issue. I've never heard of webpack.client-watch.js. What is that? I am new to Webpack and I've only been using webpack.config.js so far...

@brainthinks
Copy link

@Jakobud - when you run webpack from the terminal, you can specify a file that isn't named webpack.config.js - webpack CLI docs.

@ZhangHanDong
Copy link

it does work:

'''
webpack-dev-server --host 0.0.0.0
'''

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

No branches or pull requests

4 participants