{"action":"opened","issue":{"url":"https://api.github.com/repos/AgentME/browserify-hmr/issues/12","labels_url":"https://api.github.com/repos/AgentME/browserify-hmr/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/AgentME/browserify-hmr/issues/12/comments","events_url":"https://api.github.com/repos/AgentME/browserify-hmr/issues/12/events","html_url":"https://github.com/AgentME/browserify-hmr/issues/12","id":112459029,"number":12,"title":"Does not work with multiple bundles","user":{"login":"Gozala","id":21236,"avatar_url":"https://avatars.githubusercontent.com/u/21236?v=3","gravatar_id":"","url":"https://api.github.com/users/Gozala","html_url":"https://github.com/Gozala","followers_url":"https://api.github.com/users/Gozala/followers","following_url":"https://api.github.com/users/Gozala/following{/other_user}","gists_url":"https://api.github.com/users/Gozala/gists{/gist_id}","starred_url":"https://api.github.com/users/Gozala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gozala/subscriptions","organizations_url":"https://api.github.com/users/Gozala/orgs","repos_url":"https://api.github.com/users/Gozala/repos","events_url":"https://api.github.com/users/Gozala/events{/privacy}","received_events_url":"https://api.github.com/users/Gozala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-20T20:57:43Z","updated_at":"2015-10-20T20:57:43Z","closed_at":null,"body":"In my use case my application code consists of multiple bundles, for simplicity let's say two one for code running in main thread and other for web-worker thread. Each is bundled with a separate browserify + watchify bundle and both use hmr plugin for hot reloading.\r\n\r\nAs far as I can understand from error messages below second bundle is attempting to start a second hmr server which errors:\r\n\r\n```js\r\n[12:36:02] Requiring external module babel-core/register\r\n[12:36:04] Using gulpfile ~/Projects/browser.html/gulpfile.babel.js\r\n[12:36:04] Starting 'hotreload'...\r\n[12:36:04] Finished 'hotreload' after 426 μs\r\n[12:36:04] Starting 'develop'...\r\n[12:36:04] Starting 'watcher'...\r\n[12:36:04] Finished 'watcher' after 15 μs\r\n[12:36:04] Starting 'browser/index'...\r\n[12:36:04] Begin bundling: 'browser/index'\r\n[12:36:04] Starting 'service/history-worker'...\r\n[12:36:04] Begin bundling: 'service/history-worker'\r\n[12:36:04] Starting 'about/settings/index'...\r\n[12:36:04] Begin bundling: 'about/settings/index'\r\n12:36:21 GMT-0700 (PDT) [HMR] Emitting updates\r\n12:36:21 GMT-0700 (PDT) [HMR] Listening on localhost:3123\r\n[12:36:23] Completed bundling: 'service/history-worker'\r\n[12:36:23] Finished 'service/history-worker' after 19 s\r\n12:36:24 GMT-0700 (PDT) [HMR] Emitting updates\r\nevents.js:141\r\n      throw er; // Unhandled 'error' event\r\n      ^\r\n\r\nError: listen EADDRINUSE 127.0.0.1:3123\r\n    at Object.exports._errnoException (util.js:874:11)\r\n    at exports._exceptionWithHostPort (util.js:897:20)\r\n    at Server._listen2 (net.js:1234:14)\r\n    at listen (net.js:1270:10)\r\n    at net.js:1379:9\r\n    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:63:16)\r\n    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:82:10)\r\nevents.js:141\r\n      throw er; // Unhandled 'error' event\r\n      ^\r\n\r\nError: Browserify-HMR lost connection to socket server\r\n    at ChildProcess.<anonymous> (/Users/gozala/Projects/browser.html/node_modules/browserify-hmr/index.js:111:24)\r\n    at emitNone (events.js:67:13)\r\n    at ChildProcess.emit (events.js:166:7)\r\n    at finish (internal/child_process.js:657:14)\r\n    at doNTCallback0 (node.js:417:9)\r\n    at process._tickCallback (node.js:346:13)\r\n```\r\n\r\nIt would be nice if somehow multiple bundles could share same HMR instance. I also tried documented `key` parameter but that seems to fail due to #11 although not sure if that is what's it intended for.\r\n\r\nUse of different port and url options per bundle works although I don't find it to be an ideal."}}