Skip to content

configuration has an unknown property 'allowedHosts' #944

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

Closed
webpack-bot opened this issue Jun 17, 2017 · 5 comments
Closed

configuration has an unknown property 'allowedHosts' #944

webpack-bot opened this issue Jun 17, 2017 · 5 comments

Comments

@webpack-bot
Copy link

Do you want to request a feature or report a bug?

Bug 🐛

What is the current behavior?

I added devServer.allowedHosts to my webpack.config.js and it complains with

configuration has an unknown property 'allowedHosts'. These properties are valid:
   object { hot?, hotOnly?, lazy?, host?, filename?, publicPath?, port?, socket?, watchOptions?, headers?, clientLogLevel?, overlay?, key?, cert?, ca?, pfx?, pfxPassphrase?, inline?, disableHostCheck?, public?, https?, contentBase?, watchContentBase?, open?, features?, compress?, proxy?, historyApiFallback?, staticOptions?, setup?, stats?, reporter?, noInfo?, quiet?, serverSideRender?, index?, log?, warn? }

If the current behavior is a bug, please provide the steps to reproduce.

Just add

devServer: {
  allowedHosts: [
    '.host.com',
    'host2.com'
  ]
},

to your webpack.config.js

What is the expected behavior?

It should not complain about it because the property is documented here

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

webpack 2.6.1

I just want to access the webpack-dev-server outside of my local dev machine (e.g. my mobile phone)


This issue was moved from webpack/webpack#5080 by @bebraw. Orginal issue was by @screendriver.

@dfcowell
Copy link

Is there any workaround available for this? Just ran headlong into it. Kind of a bummer.

@bebraw
Copy link
Contributor

bebraw commented Jun 21, 2017

@dfcowell Are you using WDS 2.5.0?

@dfcowell
Copy link

dfcowell commented Jun 21, 2017

Hmm, looks like something in my config doesn't play nicely with 2.5.0. Probably unrelated. My 2.4.5 config worked fine though (apart from the issue with allowedHosts of course). I'll have a poke around and see if I can identify the issue.

If I get 2.5.0 working I'll report back with the result.

./node_modules/.bin/webpack-dev-server --config ./webpack/develop.config.js --hot --inline --content-base ./webpack
Error: addMembership EINVAL
    at Socket.addMembership (dgram.js:507:11)
    at Socket.<anonymous> (/mnt/c/Users/[my-project]/node_modules/multicast-dns/index.js:53:16)
    at emitNone (events.js:91:20)
    at Socket.emit (events.js:185:7)
    at startListening (dgram.js:121:10)
    at _handle.lookup (dgram.js:226:7)
    at _combinedTickCallback (internal/process/next_tick.js:83:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    at Module.runMain (module.js:606:11)

@bebraw
Copy link
Contributor

bebraw commented Jun 22, 2017

Yeah, I haven't seen that one before. It could be a bug somewhere but without a standalone project it's hard to tell.

@shellscape
Copy link
Contributor

This one was resolved with #1012 and is available in the latest version.

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

4 participants