{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/818","labels_url":"https://api.github.com/repos/webpack/webpack/issues/818/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/818/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/818/events","html_url":"https://github.com/webpack/webpack/issues/818","id":58689175,"number":818,"title":"Improve readability of \"Module not found\" output","user":{"login":"fresheneesz","id":149531,"avatar_url":"https://avatars.githubusercontent.com/u/149531?v=3","gravatar_id":"","url":"https://api.github.com/users/fresheneesz","html_url":"https://github.com/fresheneesz","followers_url":"https://api.github.com/users/fresheneesz/followers","following_url":"https://api.github.com/users/fresheneesz/following{/other_user}","gists_url":"https://api.github.com/users/fresheneesz/gists{/gist_id}","starred_url":"https://api.github.com/users/fresheneesz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fresheneesz/subscriptions","organizations_url":"https://api.github.com/users/fresheneesz/orgs","repos_url":"https://api.github.com/users/fresheneesz/repos","events_url":"https://api.github.com/users/fresheneesz/events{/privacy}","received_events_url":"https://api.github.com/users/fresheneesz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-24T03:35:33Z","updated_at":"2015-02-28T09:17:26Z","closed_at":null,"body":"So I've been using webpack for over a year now, and I still have a hell of a time figuring out the \"Module not found\" output. Most of it is useless output to me, and it always takes me multiple minutes to figure out what's going on. It should be immediately obvious what's broken and where.\r\n\r\nHere's an example of the *end* of some output i'm getting currently (note this continues upward with  more output):\r\n\r\n```\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextArea]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextArea]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextArea.webpack.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextArea.web.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextArea.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextArea.json]\r\n[D:\\node_modules\\TextArea]\r\n[D:\\node_modules\\TextArea]\r\n[D:\\node_modules\\TextArea.webpack.js]\r\n[D:\\node_modules\\TextArea.web.js]\r\n[D:\\node_modules\\TextArea.js]\r\n[D:\\node_modules\\TextArea.json]\r\n @ ./blocks.js 14:19-38\r\n./blocks.js\r\nModule not found: Error: Cannot resolve module 'TextField' in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\r\nresolve module TextField in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\r\n  looking for modules in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\r\n    D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField doesn't exist (module as directory)\r\n    resolve 'file' TextField in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\r\n      resolve file\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField doesn't exist\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField.webpack.js doesn't exist\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField.web.js doesn't exist\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField.js doesn't exist\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField.json doesn't exist\r\n  looking for modules in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\r\n    D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField doesn't exist (module as directory)\r\n    resolve 'file' TextField in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\r\n      resolve file\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField doesn't exist\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField.webpack.js doesn't exist\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField.web.js doesn't exist\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField.js doesn't exist\r\n        D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField.json doesn't exist\r\n  looking for modules in D:\\node_modules\r\n    D:\\node_modules\\TextField doesn't exist (module as directory)\r\n    resolve 'file' TextField in D:\\node_modules\r\n      resolve file\r\n        D:\\node_modules\\TextField doesn't exist\r\n        D:\\node_modules\\TextField.webpack.js doesn't exist\r\n        D:\\node_modules\\TextField.web.js doesn't exist\r\n        D:\\node_modules\\TextField.js doesn't exist\r\n        D:\\node_modules\\TextField.json doesn't exist\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField.webpack.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField.web.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\node_modules\\TextField.json]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField.webpack.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField.web.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\node_modules\\TextField.json]\r\n[D:\\node_modules\\TextField]\r\n[D:\\node_modules\\TextField]\r\n[D:\\node_modules\\TextField.webpack.js]\r\n[D:\\node_modules\\TextField.web.js]\r\n[D:\\node_modules\\TextField.js]\r\n[D:\\node_modules\\TextField.json]\r\n @ ./blocks.js 15:20-40\r\n./test/Block.test.js\r\nModule not found: Error: Cannot resolve 'file' or 'directory' ../blocks in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\test\r\nresolve file\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks doesn't exist\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.webpack.js doesn't exist\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.web.js doesn't exist\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.js doesn't exist\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.json doesn't exist\r\nresolve directory\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks doesn't exist (directory default file)\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks\\package.json doesn't exist (directory description file)\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.webpack.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.web.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.json]\r\n @ ./test/Block.test.js 6:13-33\r\n./test/Style.test.js\r\nModule not found: Error: Cannot resolve 'file' or 'directory' ../blocks in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\test\r\nresolve file\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks doesn't exist\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.webpack.js doesn't exist\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.web.js doesn't exist\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.js doesn't exist\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.json doesn't exist\r\nresolve directory\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks doesn't exist (directory default file)\r\n  D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks\\package.json doesn't exist (directory description file)\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.webpack.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.web.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.js]\r\n[D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.json]\r\n @ ./test/Style.test.js 4:13-33\r\n```\r\n\r\nFirst thing I want to point out is, I almost never care about *where* webpack has looked for a given module. The only time I would see that being useful is if you're A. debugging your config which for some reason (maybe?) might prevent webpack from searching in a location that node.js would search in, or B. you're debugging webpack itself. I would suggest that that kind of output is hidden unless some kind of \"verbose\" configuration is passed.\r\n\r\nSecond, even with verbose output, the \"@ ./test/Style.test.js 4:13-33\" should be right next to the require that couldn't be found. Writing \"Module not found: ...\\n bunch_of_verbose_output \\n @ ./yourfile.js\" Is really difficult to visually parse. I don't know where one error begins and another ends. \r\n\r\nThird thing is:  `@ ./blocks.js 15:20-40`. There is no file in my system called `blocks.js`. There is a file called `blocks.browser.js` which is being built to the name `blocks.umd.js`, but there's no `blocks.js`. It looks like its printing out the wrong filename there.\r\n\r\nThis is what I'd like the above output to look like:\r\n\r\n```\r\nError: Cannot resolve module 'TextField' in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.browser.js 14:19-38\r\nError: Cannot resolve module 'TextField' in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\blocks.browser.js 15:20-40\r\nError: Cannot resolve 'file' or 'directory' '../blocks' in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\test\\Block.test.js 6:13-33\r\nError: Cannot resolve 'file' or 'directory' '../blocks' in D:\\billysFile\\code\\javascript\\nodejs\\modules\\blocks.js\\src\\test\\Style.test.js 4:13-33\r\n```\r\n\r\nShort and concise, that's how an error should be. Bonus points if you do some console coloring to highlight the most important information (like the line number and filename - so like just highlight \"blocks.browser.js 14\" out of the first line). Check out [colors](https://github.com/marak/colors.js/) if you're interested in doing that."},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/76518436","html_url":"https://github.com/webpack/webpack/issues/818#issuecomment-76518436","issue_url":"https://api.github.com/repos/webpack/webpack/issues/818","id":76518436,"user":{"login":"sokra","id":1365881,"avatar_url":"https://avatars.githubusercontent.com/u/1365881?v=3","gravatar_id":"","url":"https://api.github.com/users/sokra","html_url":"https://github.com/sokra","followers_url":"https://api.github.com/users/sokra/followers","following_url":"https://api.github.com/users/sokra/following{/other_user}","gists_url":"https://api.github.com/users/sokra/gists{/gist_id}","starred_url":"https://api.github.com/users/sokra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sokra/subscriptions","organizations_url":"https://api.github.com/users/sokra/orgs","repos_url":"https://api.github.com/users/sokra/repos","events_url":"https://api.github.com/users/sokra/events{/privacy}","received_events_url":"https://api.github.com/users/sokra/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T09:17:26Z","updated_at":"2015-02-28T09:17:26Z","body":"yes you're right, `toJson` gives **all** information. It's for uploading to the analyse tool. But you can switch it off `{errorDetails: false}`."}}