{"action":"created","issue":{"url":"https://api.github.com/repos/Yomguithereal/kotatsu/issues/128","repository_url":"https://api.github.com/repos/Yomguithereal/kotatsu","labels_url":"https://api.github.com/repos/Yomguithereal/kotatsu/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/Yomguithereal/kotatsu/issues/128/comments","events_url":"https://api.github.com/repos/Yomguithereal/kotatsu/issues/128/events","html_url":"https://github.com/Yomguithereal/kotatsu/issues/128","id":152939317,"number":128,"title":"HMR Does Not Perform Swap","user":{"login":"iantanwx","id":10595596,"avatar_url":"https://avatars.githubusercontent.com/u/10595596?v=3","gravatar_id":"","url":"https://api.github.com/users/iantanwx","html_url":"https://github.com/iantanwx","followers_url":"https://api.github.com/users/iantanwx/followers","following_url":"https://api.github.com/users/iantanwx/following{/other_user}","gists_url":"https://api.github.com/users/iantanwx/gists{/gist_id}","starred_url":"https://api.github.com/users/iantanwx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iantanwx/subscriptions","organizations_url":"https://api.github.com/users/iantanwx/orgs","repos_url":"https://api.github.com/users/iantanwx/repos","events_url":"https://api.github.com/users/iantanwx/events{/privacy}","received_events_url":"https://api.github.com/users/iantanwx/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Yomguithereal/kotatsu/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-04T06:30:38Z","updated_at":"2016-05-06T19:19:40Z","closed_at":null,"body":"Hello Guillaume, and great work! Loving Kotatsu and I hope you maintain it for a long time to come.\r\n\r\nI'm having an issue using Kotatsu with HMR -- `kotatsu start --es2015 index.js` prints:\r\n\r\n```\r\n[kotatsu] (v0.13.0)\r\n[kotatsu] Compiling...\r\n[kotatsu] Done!\r\n[kotatsu] Starting your script...\r\n[kotatsu] HMR connected.\r\n```\r\n\r\n`index.js` is as follows:\r\n\r\n```\r\nimport app from './config/express';\r\nimport http from 'http';\r\n\r\nconst server = http.createServer(app);\r\nconst debug = require('debug')('ms-boilerplate:index');\r\n\r\nserver.listen(8888);\r\n\r\n// listen on port config.port\r\nif (module.hot) {\r\n\tmodule.hot.accept('./config/express.js', () => {\r\n\t\tserver.removeListener('request', app);\r\n\t\tlet express = require('./config/express.js');\r\n\t\tserver.on('request', express);\r\n\t\tdebug('Server reloaded.');\r\n\t});\r\n}\r\n\r\nexport default app;\r\n```\r\n\r\nexpress.js contains the standard express configuration, where the usual middleware etc. gets set up. When I edit and save express.js however, HMR doesn't seem to rebuild the bundle. It's worth mentioning that nodemon also appears to fail; it doesn't trigger the tasks (in gulp) that it should trigger. I thought this might have been an issue with OS X, so I spun up a fresh VM and tried again -- but the same issue results with both kotatsu and nodemon.\r\n\r\nAll routes work when I test them with swagger-ui; but HMR (or the file watcher) seems to refuse to rebuild on any changes. \r\n\r\nAny help would be greatly appreciated. Cheers!"},"comment":{"url":"https://api.github.com/repos/Yomguithereal/kotatsu/issues/comments/217535214","html_url":"https://github.com/Yomguithereal/kotatsu/issues/128#issuecomment-217535214","issue_url":"https://api.github.com/repos/Yomguithereal/kotatsu/issues/128","id":217535214,"user":{"login":"Yomguithereal","id":2571951,"avatar_url":"https://avatars.githubusercontent.com/u/2571951?v=3","gravatar_id":"","url":"https://api.github.com/users/Yomguithereal","html_url":"https://github.com/Yomguithereal","followers_url":"https://api.github.com/users/Yomguithereal/followers","following_url":"https://api.github.com/users/Yomguithereal/following{/other_user}","gists_url":"https://api.github.com/users/Yomguithereal/gists{/gist_id}","starred_url":"https://api.github.com/users/Yomguithereal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yomguithereal/subscriptions","organizations_url":"https://api.github.com/users/Yomguithereal/orgs","repos_url":"https://api.github.com/users/Yomguithereal/repos","events_url":"https://api.github.com/users/Yomguithereal/events{/privacy}","received_events_url":"https://api.github.com/users/Yomguithereal/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T19:19:40Z","updated_at":"2016-05-06T19:19:40Z","body":"Ok, so I tried the repo, installed the deps, started the server and, after I changed this line:\r\n\r\n```js\r\nlet express = require('./config/express.js').default;\r\n```\r\n\r\nthe HMR does work (else it will fire an error because without the default you are trying to attach an undefined handler and the event emitter does not like that)."}}