{"action":"created","issue":{"url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/1774","repository_url":"https://api.github.com/repos/SharePoint/sp-dev-docs","labels_url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/1774/labels{/name}","comments_url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/1774/comments","events_url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/1774/events","html_url":"https://github.com/SharePoint/sp-dev-docs/issues/1774","id":319135746,"node_id":"MDU6SXNzdWUzMTkxMzU3NDY=","number":1774,"title":"'Cannot read property 'id' of undefined' error when trying to debug a web part using MSGraphClient in the hosted workbench","user":{"login":"waldekmastykarz","id":11164679,"node_id":"MDQ6VXNlcjExMTY0Njc5","avatar_url":"https://avatars2.githubusercontent.com/u/11164679?v=4","gravatar_id":"","url":"https://api.github.com/users/waldekmastykarz","html_url":"https://github.com/waldekmastykarz","followers_url":"https://api.github.com/users/waldekmastykarz/followers","following_url":"https://api.github.com/users/waldekmastykarz/following{/other_user}","gists_url":"https://api.github.com/users/waldekmastykarz/gists{/gist_id}","starred_url":"https://api.github.com/users/waldekmastykarz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waldekmastykarz/subscriptions","organizations_url":"https://api.github.com/users/waldekmastykarz/orgs","repos_url":"https://api.github.com/users/waldekmastykarz/repos","events_url":"https://api.github.com/users/waldekmastykarz/events{/privacy}","received_events_url":"https://api.github.com/users/waldekmastykarz/received_events","type":"User","site_admin":false},"labels":[{"id":427068432,"node_id":"MDU6TGFiZWw0MjcwNjg0MzI=","url":"https://api.github.com/repos/SharePoint/sp-dev-docs/labels/area:framework","name":"area:framework","color":"e99695","default":false},{"id":422233691,"node_id":"MDU6TGFiZWw0MjIyMzM2OTE=","url":"https://api.github.com/repos/SharePoint/sp-dev-docs/labels/type:bug","name":"type:bug","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-05-01T07:25:05Z","updated_at":"2018-06-02T16:00:48Z","closed_at":null,"author_association":"MEMBER","body":"#### Category\r\n- [ ] Question\r\n- [ ] Typo\r\n- [x] Bug\r\n- [ ] Additional article idea\r\n\r\n#### Expected or Desired Behavior\r\n\r\nBe able to debug web part using MSGraphClient in the hosted workbench while serving from the local web server.\r\n\r\n#### Observed Behavior\r\n\r\nAfter adding the web part to the page, you get the following error in the console:\r\n\r\n```\r\nsp-webpart-workbench-assembly_en-us_9f8c6f0aa83e12a3358a5cca73b1ce92.js:283 Uncaught (in promise) TypeError: Cannot read property 'id' of undefined\r\n    at e.consume (sp-webpart-workbench-assembly_en-us_9f8c6f0aa83e12a3358a5cca73b1ce92.js:283)\r\n    at sp-client-preview.js:94\r\n    at e._processPendingCallbacks (sp-webpart-workbench-assembly_en-us_9f8c6f0aa83e12a3358a5cca73b1ce92.js:283)\r\n    at e.consume (sp-webpart-workbench-assembly_en-us_9f8c6f0aa83e12a3358a5cca73b1ce92.js:283)\r\n    at e.consume (sp-webpart-workbench-assembly_en-us_9f8c6f0aa83e12a3358a5cca73b1ce92.js:283)\r\n    at e.consume (sp-webpart-workbench-assembly_en-us_9f8c6f0aa83e12a3358a5cca73b1ce92.js:283)\r\n    at PersonalCalendarWebPart.render (PersonalCalendarWebPart.ts:33)\r\n    at t (sp-webpart-workbench-assembly_en-us_9f8c6f0aa83e12a3358a5cca73b1ce92.js:569)\r\n    at PersonalCalendarWebPart.t._renderWithAccessibleTitle (sp-webpart-workbench-assembly_en-us_9f8c6f0aa83e12a3358a5cca73b1ce92.js:569)\r\n    at sp-webpart-workbench-assembly_en-us_9f8c6f0aa83e12a3358a5cca73b1ce92.js:569\r\n```\r\n\r\nTenant is running on the `2018-04-20.015` release of SPFx.\r\n\r\n#### Steps to Reproduce\r\n\r\n- scaffold new project using generator v1.4.1 with a React web part\r\n- to the `render` method add:\r\n\r\n```ts\r\nconst graphClient = this.context.serviceScope.consume(MSGraphClient.serviceKey);\r\ngraphClient.api('me').version('v1.0').get();\r\n```\r\n\r\n- run `gulp serve --nobrowser`\r\n- in the hosted workbench, add the web part to the canvas\r\n- in the console you get the aforementioned error"},"comment":{"url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/comments/394097430","html_url":"https://github.com/SharePoint/sp-dev-docs/issues/1774#issuecomment-394097430","issue_url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/1774","id":394097430,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDA5NzQzMA==","user":{"login":"JayakumarB","id":11646986,"node_id":"MDQ6VXNlcjExNjQ2OTg2","avatar_url":"https://avatars1.githubusercontent.com/u/11646986?v=4","gravatar_id":"","url":"https://api.github.com/users/JayakumarB","html_url":"https://github.com/JayakumarB","followers_url":"https://api.github.com/users/JayakumarB/followers","following_url":"https://api.github.com/users/JayakumarB/following{/other_user}","gists_url":"https://api.github.com/users/JayakumarB/gists{/gist_id}","starred_url":"https://api.github.com/users/JayakumarB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayakumarB/subscriptions","organizations_url":"https://api.github.com/users/JayakumarB/orgs","repos_url":"https://api.github.com/users/JayakumarB/repos","events_url":"https://api.github.com/users/JayakumarB/events{/privacy}","received_events_url":"https://api.github.com/users/JayakumarB/received_events","type":"User","site_admin":false},"created_at":"2018-06-02T16:00:48Z","updated_at":"2018-06-02T16:00:48Z","author_association":"NONE","body":"Thanks @waldekmastykarz your solution works fine."}}
{"actor":{"display_login":"JayakumarB"}}