{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/9832","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/9832/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/9832/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/9832/events","html_url":"https://github.com/facebook/react-native/pull/9832","id":176142249,"number":9832,"title":"[ResolutionRequest] Fix node_modules resolution error messages","user":{"login":"aleclarson","id":1925840,"avatar_url":"https://avatars.githubusercontent.com/u/1925840?v=3","gravatar_id":"","url":"https://api.github.com/users/aleclarson","html_url":"https://github.com/aleclarson","followers_url":"https://api.github.com/users/aleclarson/followers","following_url":"https://api.github.com/users/aleclarson/following{/other_user}","gists_url":"https://api.github.com/users/aleclarson/gists{/gist_id}","starred_url":"https://api.github.com/users/aleclarson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleclarson/subscriptions","organizations_url":"https://api.github.com/users/aleclarson/orgs","repos_url":"https://api.github.com/users/aleclarson/repos","events_url":"https://api.github.com/users/aleclarson/events{/privacy}","received_events_url":"https://api.github.com/users/aleclarson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-10T00:28:02Z","updated_at":"2016-09-18T21:43:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/9832","html_url":"https://github.com/facebook/react-native/pull/9832","diff_url":"https://github.com/facebook/react-native/pull/9832.diff","patch_url":"https://github.com/facebook/react-native/pull/9832.patch"},"body":"We could probably relieve a lot of pain (in [this issue](https://github.com/facebook/react-native/issues/4968) specifically) by fixing the error message for when a module cannot be resolved after trying every relevant `node_modules` directory.\r\n\r\nCurrently, you get a confusing error message that only gives you the last `node_modules` directory checked. By creating the error message where we can access the `searchQueue`, we're able to provide all of the attempted `node_modules` directories.\r\n\r\n<details>\r\n  <summary>View example of new error message format</summary>\r\n```  \r\nUnable to resolve module leftpad from /Users/aleclarson/ReactProject/src/stuff/index.js: \r\nModule does not exist in the module map or as these directories:\r\n  /Users/aleclarson/ReactProject/src/stuff/node_modules/leftpad\r\n  /Users/aleclarson/ReactProject/src/node_modules/leftpad\r\n  /Users/aleclarson/ReactProject/node_modules/leftpad\r\n  /Users/aleclarson/node_modules/leftpad\r\n  /Users/node_modules/leftpad\r\n```\r\n</details>\r\n\r\nLMK if there are any nits + LGTM asap 😄 "},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/247882769","html_url":"https://github.com/facebook/react-native/pull/9832#issuecomment-247882769","issue_url":"https://api.github.com/repos/facebook/react-native/issues/9832","id":247882769,"user":{"login":"aleclarson","id":1925840,"avatar_url":"https://avatars.githubusercontent.com/u/1925840?v=3","gravatar_id":"","url":"https://api.github.com/users/aleclarson","html_url":"https://github.com/aleclarson","followers_url":"https://api.github.com/users/aleclarson/followers","following_url":"https://api.github.com/users/aleclarson/following{/other_user}","gists_url":"https://api.github.com/users/aleclarson/gists{/gist_id}","starred_url":"https://api.github.com/users/aleclarson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleclarson/subscriptions","organizations_url":"https://api.github.com/users/aleclarson/orgs","repos_url":"https://api.github.com/users/aleclarson/repos","events_url":"https://api.github.com/users/aleclarson/events{/privacy}","received_events_url":"https://api.github.com/users/aleclarson/received_events","type":"User","site_admin":false},"created_at":"2016-09-18T21:43:46Z","updated_at":"2016-09-18T21:43:46Z","body":"With #9973, the error message is **even cleaner**!\r\n\r\nLet's assume the only existing `node_modules` is `/Users/aleclarson/ReactProject/node_modules/leftpad`.\r\n\r\nSince #9973 checks if each directory exists before adding it to the search queue, we get this:\r\n\r\n```\r\nUnable to resolve module leftpad from /Users/aleclarson/ReactProject/src/stuff/index.js: \r\nModule does not exist in the module map or as these directories:\r\n  /Users/aleclarson/ReactProject/node_modules/leftpad\r\n```\r\n\r\nNo more noise! 🎉 \r\n\r\nLGTM @davidaurelio "}}
{"actor":{"display_login":"aleclarson"}}