{"action":"opened","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/5399","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/5399/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/5399/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/5399/events","html_url":"https://github.com/webpack/webpack/issues/5399","id":246208921,"number":5399,"title":"webpack --watch breaking site after modifying a file","user":{"login":"juan-bastidas","id":17748201,"avatar_url":"https://avatars1.githubusercontent.com/u/17748201?v=4","gravatar_id":"","url":"https://api.github.com/users/juan-bastidas","html_url":"https://github.com/juan-bastidas","followers_url":"https://api.github.com/users/juan-bastidas/followers","following_url":"https://api.github.com/users/juan-bastidas/following{/other_user}","gists_url":"https://api.github.com/users/juan-bastidas/gists{/gist_id}","starred_url":"https://api.github.com/users/juan-bastidas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juan-bastidas/subscriptions","organizations_url":"https://api.github.com/users/juan-bastidas/orgs","repos_url":"https://api.github.com/users/juan-bastidas/repos","events_url":"https://api.github.com/users/juan-bastidas/events{/privacy}","received_events_url":"https://api.github.com/users/juan-bastidas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-28T00:52:50Z","updated_at":"2017-07-28T00:52:50Z","closed_at":null,"body":"<!-- Please don't delete this template or we'll close your issue -->\r\n<!-- Before creating an issue please make sure you are using the latest version of webpack. -->\r\n<!-- Also consider trying the webpack@beta version, maybe it's already fixed. -->\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n\r\n<!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). -->\r\n<!-- Issues which contain questions or support requests will be closed. -->\r\n\r\n**What is the current behavior?**\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\n\r\n<!-- A great way to do this is to provide your configuration via a GitHub gist. -->\r\n<!-- Best provide a minimal reproduceable repo -->\r\n<!-- If your issue is caused by a plugin or loader file the issue on the plugin/loader repo -->\r\n\r\n**What is the expected behavior?**\r\n\r\n**If this is a feature request, what is motivation or use case for changing the behavior?**\r\n\r\n**Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.**\r\n\r\nI have an application built with react, one of the components is using a node_module and importing a css file like:\r\n\r\nimport 'module/styles/styles.css';\r\n\r\nI start the build using --watch option and everything is built OK and the site loads fine.\r\nThe after modifying any file I get the following error:\r\n\r\nUncaught (in promise) TypeError: __webpack_require__(...) is not a function\r\n\r\nThis error points to the CSS file:\r\n\r\nexports = module.exports = require(\"../../css-loader/lib/css-base.js\")();\r\n\r\nThe error is on the line above, which will call:\r\n\r\n// style-loader: Adds some css to the DOM by adding a <style> tag\r\n\r\n// load the styles\r\nvar content = require(\"!!../../css-loader/index.js!./styles.css\");\r\nif(typeof content === 'string') content = [[module.id, content, '']];\r\n\r\nDebugging this, the first time webpack is built module ID here is 914 but after modifying the file it is 1, something is very weird when webpack rebuilds after the change.\r\n\r\nI have a laoder for CSS as follows:\r\n\r\n            {\r\n                test: /\\.css$/,\r\n                loader: 'style-loader!css-loader'\r\n            },\r\n\r\nAny clue? Thoughts?"}}
{"actor":{"display_login":"juan-bastidas"}}