Webpack-dev-server: Windows 10 Bash on Windows Error: addMembership EINVAL

Created on 22 Jun 2017  路  8Comments  路  Source: webpack/webpack-dev-server

After updating from 2.4.5 to 2.5.0 it starts to give an error during start up. It happens straight away.

> node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --progress --colors

 10% building modules 1/1 modules 0 activeevents.js:182
      throw er; // Unhandled 'error' event
      ^

Error: addMembership EINVAL
    at exports._errnoException (util.js:1016:11)
    at Socket.addMembership (dgram.js:579:11)
    at Socket.<anonymous> (/mnt/f/****/****/app/node_modules/multicast-dns/index.js:53:16)
    at emitNone (events.js:110:20)
    at Socket.emit (events.js:207:7)
    at startListening (dgram.js:144:10)
    at _handle.lookup (dgram.js:249:7)
    at _combinedTickCallback (internal/process/next_tick.js:105:11)
    at process._tickCallback (internal/process/next_tick.js:161:9)
    at Function.Module.runMain (module.js:607:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! *****@4.4.0 dev: `node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --progress --colors`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the *****@4.4.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/****/.npm/_logs/2017-06-22T13_00_13_678Z-debug.log

Hide some sensitive info by star symbol.

I'm using dev server on Bash on Windows (Ubuntu inside Windows 10). As error showes problem with sockets, it's impossible to use sockets or other core stuff on Bash on Windows only user mode. I guess error related to this limitation. How this can be fixed?
Looks not good, some minor update completely breaks stuff.

Most helpful comment

So I ran into this issue as well, and after hours wasted, I finally found a workaround. As long as you aren't using the --bonjour flag, edit node_modules/webpack-dev-server/bin/webpack-dev-server.js and change
const bonjour = require("bonjour")();
to
const bonjour = {};
Basically, WSL has NO support for mdns, which Bonjour is built upon, and appears to enable when imported.

All 8 comments

So I ran into this issue as well, and after hours wasted, I finally found a workaround. As long as you aren't using the --bonjour flag, edit node_modules/webpack-dev-server/bin/webpack-dev-server.js and change
const bonjour = require("bonjour")();
to
const bonjour = {};
Basically, WSL has NO support for mdns, which Bonjour is built upon, and appears to enable when imported.

Yeah, thanks for finding workaround! But it's not a solution unfortunately, it should be fixed in library globally imho.

@StalkAlex absolutely! However, this is an issue with the Windows subsystem, not with bonjour. However, a better error and perhaps checking before enabling would be appropriate.

Agreed! that's correct, bonjour should be initialized only when option is enabled.

This happened for me. I can confirm that the workaround mentioned works. (windows 10 creators update, ubuntu 16.04 via WSL, node 7.10)

I ran into this too.

In the windows insider mdns support was already added, but I didn't test it yet: https://github.com/Microsoft/BashOnWindows/issues/2245#issuecomment-310546134.

This issue also exists on Linux, depending on the configuration. In my case I get the following stack trace:

Error: addMembership ENOBUFS
    at exports._errnoException (util.js:1016:11)
    at Socket.addMembership (dgram.js:579:11)
    at Socket.<anonymous> (/usr/local/nvm/versions/node/v8.1.2/lib/node_modules/webpack-dev-server/node_modules/multicast-dns/index.js:53:16)
    at emitNone (events.js:110:20)
    at Socket.emit (events.js:207:7)
    at startListening (dgram.js:144:10)
    at _handle.lookup (dgram.js:249:7)
    at _combinedTickCallback (internal/process/next_tick.js:105:11)
    at process._tickCallback (internal/process/next_tick.js:161:9)
    at Function.Module.runMain (module.js:607:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

This is fixed by the pull request above.

@shellscape Sorry for the multi comments on the PR, I forgot there was an initial issue. Thank you for merging and have a great day.

Was this page helpful?
0 / 5 - 0 ratings