{"action":"closed","number":6614,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/6614","id":63954558,"html_url":"https://github.com/facebook/react-native/pull/6614","diff_url":"https://github.com/facebook/react-native/pull/6614.diff","patch_url":"https://github.com/facebook/react-native/pull/6614.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/6614","number":6614,"state":"closed","locked":false,"title":"Improve display of error in debugger console","user":{"login":"satya164","id":1174278,"avatar_url":"https://avatars.githubusercontent.com/u/1174278?v=3","gravatar_id":"","url":"https://api.github.com/users/satya164","html_url":"https://github.com/satya164","followers_url":"https://api.github.com/users/satya164/followers","following_url":"https://api.github.com/users/satya164/following{/other_user}","gists_url":"https://api.github.com/users/satya164/gists{/gist_id}","starred_url":"https://api.github.com/users/satya164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satya164/subscriptions","organizations_url":"https://api.github.com/users/satya164/orgs","repos_url":"https://api.github.com/users/satya164/repos","events_url":"https://api.github.com/users/satya164/events{/privacy}","received_events_url":"https://api.github.com/users/satya164/received_events","type":"User","site_admin":false},"body":"The error message in chrome debugger are useless right now. As you cannot get any useful info from them except the error message. Ideally it should contain the proper stack trace with source maps to actually be useful.\r\n\r\nCurrently, the only alternative is, find the file name and line number on phone, and then open the corresponding file in the sources panel, then scroll to the lines number, as opposed to clicking a link on the console and directly going to the file.\r\n\r\nI've been looking into how to do it. And would really like your thoughts on how to achieve it.\r\n\r\n1. We can forget sourcemaps, and just log the error object with `console.error(e)` instead of how we're doing it right now, i.e. - `console.error(e.message)`. Doing this will help in jumping to the line in the bundle much easier. Even if sourcemaps are not there, you quickly get the idea of where the error came from, and adding breakpoints in the transformed source. Even if it's worse than sourcemaps, it's pretty convenient.\r\n\r\n2. We can compromise a bit, and show a `console.log` instead of actual error (the stack trace is not useful anyways), and then log the actual error as soon as source maps arrive. This PR implements that currently.\r\n\r\n![react native debugger google chrome today at 2 42 13 am](https://cloud.githubusercontent.com/assets/1174278/14001108/75695b0a-f16a-11e5-9dbd-3c272ce51100.png)\r\n\r\nThis is how it looks in the console, which I think is eons better than what we currently have.\r\n\r\n**Caveats:** Currently there seems to be bug in master where the sourcemap is not loaded until you  interact with app. Also the parser we're using for getting the stacktraces from sourcemaps right now doesn't seem to give column numbers.\r\n\r\nWould love your thoughts and ideas on how to improve this. I believe debugging should be as easy as possible.\r\n","created_at":"2016-03-23T21:18:07Z","updated_at":"2016-08-04T07:45:37Z","closed_at":"2016-08-04T07:45:37Z","merged_at":null,"merge_commit_sha":"14c8cb904b4c36ecd5f982a51ea8573d0c9ae397","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/6614/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/6614/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/6614/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/05e0050dc389f0521f441b87c462e6ce7aecfab6","head":{"label":"satya164:error-debug","ref":"error-debug","sha":"05e0050dc389f0521f441b87c462e6ce7aecfab6","user":{"login":"satya164","id":1174278,"avatar_url":"https://avatars.githubusercontent.com/u/1174278?v=3","gravatar_id":"","url":"https://api.github.com/users/satya164","html_url":"https://github.com/satya164","followers_url":"https://api.github.com/users/satya164/followers","following_url":"https://api.github.com/users/satya164/following{/other_user}","gists_url":"https://api.github.com/users/satya164/gists{/gist_id}","starred_url":"https://api.github.com/users/satya164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satya164/subscriptions","organizations_url":"https://api.github.com/users/satya164/orgs","repos_url":"https://api.github.com/users/satya164/repos","events_url":"https://api.github.com/users/satya164/events{/privacy}","received_events_url":"https://api.github.com/users/satya164/received_events","type":"User","site_admin":false},"repo":{"id":42726415,"name":"react-native","full_name":"satya164/react-native","owner":{"login":"satya164","id":1174278,"avatar_url":"https://avatars.githubusercontent.com/u/1174278?v=3","gravatar_id":"","url":"https://api.github.com/users/satya164","html_url":"https://github.com/satya164","followers_url":"https://api.github.com/users/satya164/followers","following_url":"https://api.github.com/users/satya164/following{/other_user}","gists_url":"https://api.github.com/users/satya164/gists{/gist_id}","starred_url":"https://api.github.com/users/satya164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satya164/subscriptions","organizations_url":"https://api.github.com/users/satya164/orgs","repos_url":"https://api.github.com/users/satya164/repos","events_url":"https://api.github.com/users/satya164/events{/privacy}","received_events_url":"https://api.github.com/users/satya164/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/satya164/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/satya164/react-native","forks_url":"https://api.github.com/repos/satya164/react-native/forks","keys_url":"https://api.github.com/repos/satya164/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/satya164/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/satya164/react-native/teams","hooks_url":"https://api.github.com/repos/satya164/react-native/hooks","issue_events_url":"https://api.github.com/repos/satya164/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/satya164/react-native/events","assignees_url":"https://api.github.com/repos/satya164/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/satya164/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/satya164/react-native/tags","blobs_url":"https://api.github.com/repos/satya164/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/satya164/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/satya164/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/satya164/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/satya164/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/satya164/react-native/languages","stargazers_url":"https://api.github.com/repos/satya164/react-native/stargazers","contributors_url":"https://api.github.com/repos/satya164/react-native/contributors","subscribers_url":"https://api.github.com/repos/satya164/react-native/subscribers","subscription_url":"https://api.github.com/repos/satya164/react-native/subscription","commits_url":"https://api.github.com/repos/satya164/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/satya164/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/satya164/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/satya164/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/satya164/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/satya164/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/satya164/react-native/merges","archive_url":"https://api.github.com/repos/satya164/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/satya164/react-native/downloads","issues_url":"https://api.github.com/repos/satya164/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/satya164/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/satya164/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/satya164/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/satya164/react-native/labels{/name}","releases_url":"https://api.github.com/repos/satya164/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/satya164/react-native/deployments","created_at":"2015-09-18T14:14:48Z","updated_at":"2016-03-21T18:47:23Z","pushed_at":"2016-06-14T13:30:20Z","git_url":"git://github.com/satya164/react-native.git","ssh_url":"git@github.com:satya164/react-native.git","clone_url":"https://github.com/satya164/react-native.git","svn_url":"https://github.com/satya164/react-native","homepage":"http://facebook.github.io/react-native/","size":47047,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"4f8668b11092de84a911f92c1e0b19cfedbb8a33","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react-native/deployments","created_at":"2015-01-09T18:10:16Z","updated_at":"2016-08-04T07:43:54Z","pushed_at":"2016-08-04T06:47:52Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":115720,"stargazers_count":35838,"watchers_count":35838,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7783,"mirror_url":null,"open_issues_count":1059,"forks":7783,"open_issues":1059,"watchers":35838,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/6614"},"html":{"href":"https://github.com/facebook/react-native/pull/6614"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/6614"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/6614/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/6614/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/6614/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/05e0050dc389f0521f441b87c462e6ce7aecfab6"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":7,"review_comments":0,"commits":2,"additions":19,"deletions":5,"changed_files":2}}
{"actor":{"display_login":"satya164"}}