{"action":"created","issue":{"url":"https://api.github.com/repos/parcel-bundler/parcel/issues/809","repository_url":"https://api.github.com/repos/parcel-bundler/parcel","labels_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/809/labels{/name}","comments_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/809/comments","events_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/809/events","html_url":"https://github.com/parcel-bundler/parcel/issues/809","id":297217220,"node_id":"MDU6SXNzdWUyOTcyMTcyMjA=","number":809,"title":"[Bug] HMR and PostCSS modules, styles disappear","user":{"login":"pavel","id":5321105,"node_id":"MDQ6VXNlcjUzMjExMDU=","avatar_url":"https://avatars2.githubusercontent.com/u/5321105?v=4","gravatar_id":"","url":"https://api.github.com/users/pavel","html_url":"https://github.com/pavel","followers_url":"https://api.github.com/users/pavel/followers","following_url":"https://api.github.com/users/pavel/following{/other_user}","gists_url":"https://api.github.com/users/pavel/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel/subscriptions","organizations_url":"https://api.github.com/users/pavel/orgs","repos_url":"https://api.github.com/users/pavel/repos","events_url":"https://api.github.com/users/pavel/events{/privacy}","received_events_url":"https://api.github.com/users/pavel/received_events","type":"User","site_admin":false},"labels":[{"id":663703608,"node_id":"MDU6TGFiZWw2NjM3MDM2MDg=","url":"https://api.github.com/repos/parcel-bundler/parcel/labels/:bug:%20Bug","name":":bug: Bug","color":"d93f0b","default":false},{"id":817394837,"node_id":"MDU6TGFiZWw4MTczOTQ4Mzc=","url":"https://api.github.com/repos/parcel-bundler/parcel/labels/CSS%20Preprocessing","name":"CSS Preprocessing","color":"f5f5f5","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2018-02-14T19:30:05Z","updated_at":"2018-08-02T06:41:09Z","closed_at":"2018-07-01T20:49:01Z","author_association":"NONE","body":"🐛 bug report\r\n\r\n### 🎛 Configuration\r\n\r\n.babelrc\r\n```json\r\n{\r\n\t\"presets\": [\r\n\t\t\"react\",\r\n\t\t[\"env\", {\r\n\t\t\t\"targets\": {\r\n\t\t\t\t\"browsers\": [ \"last 2 versions\" ]\r\n\t\t\t},\r\n\t\t\t\"debug\": true\r\n\t\t}]\r\n\t]\r\n}\r\n```\r\n\r\n.postcssrc.js\r\n```js\r\nmodule.exports = {\r\n\tmodules: true,\r\n\tplugins: {\r\n\t\t\"autoprefixer\": {}\r\n\t}\r\n};\r\n```\r\n\r\nbrowserslist\r\n```\r\nlast 2 versions\r\n```\r\n\r\nindex.html\r\n```html\r\n<!doctype html>\r\n<html>\r\n\t<head>\r\n\t\t<meta charset=\"utf-8\">\r\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n\t\t<title>React App</title>\r\n\t</head>\r\n\t<body>\r\n\t\t<div id=\"app\"></div>\r\n\r\n\t\t<script src=\"./index.js\"></script>\r\n\t</body>\r\n</html>\r\n```\r\n\r\nindex.js\r\n```js\r\nrequire(\"babel-polyfill\");\r\n\r\nconst styles = require(\"./app.styl\");\r\n\r\nconsole.log(\"styles???\", styles);\r\n\r\nconst React = require(\"react\");\r\nconst ReactDOM = require(\"react-dom\");\r\n\r\nconst App = () => (\r\n\t<div className={ styles.app }>Hello!!</div>\r\n);\r\n\r\nReactDOM.render(<App/>, document.getElementById(\"app\"));\r\n```\r\n\r\napp.styl\r\n```styl\r\n.app\r\n\tcolor: blue\r\n\ttransform: scale(0.95)\r\n\ttransition: transform 0.4s ease\r\n```\r\n\r\nCLI: `./node_modules/.bin/parcel index.html`\r\n\r\n### 🤔 Expected Behavior\r\n\r\nChanging `app.styl` should update styles properly.\r\n\r\n### 😯 Current Behavior\r\n\r\nStyles disappear after change to `app.styl`.\r\n`index.js` (which requires `app.styl`) is not reloaded when the `app.styl` file is changed.\r\n\r\n### 💻 Code Sample\r\n\r\nSource code: \r\n[parcel-postcss-modules-bug.tar.gz](https://github.com/parcel-bundler/parcel/files/1725533/parcel-postcss-modules-bug.tar.gz)\r\n\r\n### 🌍 Your Environment\r\n\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.5.1 and `master` at 6deec80b3491dc5ac690da6550323b51deec6530\r\n| Node             | 9.5.0\r\n| npm         | 5.6.0\r\n| Operating System | Linux x86_64\r\n"},"comment":{"url":"https://api.github.com/repos/parcel-bundler/parcel/issues/comments/409822859","html_url":"https://github.com/parcel-bundler/parcel/issues/809#issuecomment-409822859","issue_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/809","id":409822859,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTgyMjg1OQ==","user":{"login":"yanisvieilly","id":1003612,"node_id":"MDQ6VXNlcjEwMDM2MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/1003612?v=4","gravatar_id":"","url":"https://api.github.com/users/yanisvieilly","html_url":"https://github.com/yanisvieilly","followers_url":"https://api.github.com/users/yanisvieilly/followers","following_url":"https://api.github.com/users/yanisvieilly/following{/other_user}","gists_url":"https://api.github.com/users/yanisvieilly/gists{/gist_id}","starred_url":"https://api.github.com/users/yanisvieilly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanisvieilly/subscriptions","organizations_url":"https://api.github.com/users/yanisvieilly/orgs","repos_url":"https://api.github.com/users/yanisvieilly/repos","events_url":"https://api.github.com/users/yanisvieilly/events{/privacy}","received_events_url":"https://api.github.com/users/yanisvieilly/received_events","type":"User","site_admin":false},"created_at":"2018-08-02T06:41:09Z","updated_at":"2018-08-02T06:41:09Z","author_association":"NONE","body":"@joakin When I use `--no-hmr`, it works perfectly. When I don't, my CSS file and the references to its classes in my JS file are left intact. I tried your solution with `generateScopedName` and unfortunately, it doesn't work any better. ☹️"}}
{"actor":{"display_login":"yanisvieilly"}}