{"action":"closed","issue":{"url":"https://api.github.com/repos/parcel-bundler/parcel/issues/321","repository_url":"https://api.github.com/repos/parcel-bundler/parcel","labels_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/321/labels{/name}","comments_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/321/comments","events_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/321/events","html_url":"https://github.com/parcel-bundler/parcel/issues/321","id":282696055,"number":321,"title":"HMR failed in Electron","user":{"login":"yuqianma","id":3090650,"avatar_url":"https://avatars0.githubusercontent.com/u/3090650?v=4","gravatar_id":"","url":"https://api.github.com/users/yuqianma","html_url":"https://github.com/yuqianma","followers_url":"https://api.github.com/users/yuqianma/followers","following_url":"https://api.github.com/users/yuqianma/following{/other_user}","gists_url":"https://api.github.com/users/yuqianma/gists{/gist_id}","starred_url":"https://api.github.com/users/yuqianma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuqianma/subscriptions","organizations_url":"https://api.github.com/users/yuqianma/orgs","repos_url":"https://api.github.com/users/yuqianma/repos","events_url":"https://api.github.com/users/yuqianma/events{/privacy}","received_events_url":"https://api.github.com/users/yuqianma/received_events","type":"User","site_admin":false},"labels":[{"id":663703608,"url":"https://api.github.com/repos/parcel-bundler/parcel/labels/%23Bug","name":"#Bug","color":"e99695","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-12-17T14:06:44Z","updated_at":"2018-02-14T04:26:08Z","closed_at":"2018-02-14T04:26:07Z","author_association":"NONE","body":"<!---\r\nThanks for filing an issue 😄 ! Before you submit, please read the following:\r\n\r\nSearch open/closed issues before submitting since someone might have asked the same thing before!\r\n-->\r\n\r\n**Choose one:** is this a 🐛 bug report or 🙋 feature request?\r\n🐛 \r\n<!--- Provide a general summary of the issue in the title above -->\r\n\r\n### 🎛 Configuration (.babelrc, package.json, cli command)\r\n<!--- If describing a bug, tell us what your babel configuration looks like -->\r\nany\r\n\r\n### 🤔 Expected Behavior\r\n<!--- If you're describing a bug, tell us what should happen -->\r\n<!--- If you're suggesting a change/improvement, tell us how it should work -->\r\n\r\nHMR in electron's BrowserWindow\r\n\r\n### 😯 Current Behavior\r\n<!--- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!--- If you are seeing an error, please include the full error message and stack trace -->\r\n<!--- If suggesting a change/improvement, explain the difference from current behavior -->\r\n\r\nNo HMR\r\n\r\n### 💁 Possible Solution\r\n<!--- Not obligatory, but suggest a fix/reason for the bug, -->\r\n<!--- or ideas how to implement the addition or change -->\r\n\r\nI found the HMR init logic depends on the the `module` object. But the `BrowserWindow` in electron has its own window.module. That leads to the bug.\r\nhttps://github.com/parcel-bundler/parcel/blob/b7b2991d69b960d9f2951828b8145a6d9396ee4e/src/builtins/hmr-runtime.js#L17\r\n\r\nA temporary solution is setting `nodeIntegration` to false in BrowserWindow's options. But it removes some facilities in Electron. For someone indeed need node-integration, here may be a workaround: https://github.com/electron/electron/issues/5113 . However, I wish parcel could handle it.\r\n\r\n### 🔦 Context\r\n<!--- How has this issue affected you? What are you trying to accomplish? -->\r\n<!--- Providing context helps us come up with a solution that is most useful in the real world -->\r\n\r\nUse parcel with Electron.\r\n\r\n### 🌍 Your Environment\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n| Software         | Version(s)\r\n| ---------------- | ----------\r\n| Parcel           |  1.2.0\r\n| Node             |  v8.9.3\r\n| npm/Yarn         |  npm 5.6.0\r\n| Operating System | mac 10.13.2\r\n\r\n<!-- Love parcel? Please consider supporting our collective:\r\n👉  https://opencollective.com/parcel/donate -->"}}
{"actor":{"display_login":"brandon93s"}}