Question
Bug
I added code from this documentation https://github.com/SharePoint/sp-dev-docs/blob/master/docs/spfx/use-msgraph.md
When it hit line
const client: MSGraphClient = this.context.serviceScope.consume(MSGraphClient.serviceKey);
i get this exception
sp-client-preview.js:128 Uncaught (in promise) TypeError: Cannot read property 'PROD_OAUTH_TOKEN_URL' of undefined
at MSGraphClient._configureGraphSDK (sp-client-preview.js:128)
at sp-client-preview.js:94
at e._processPendingCallbacks (sp-webpart-workbench-assembly_en-us_c62a811b76aa07bcefefad77b22b5dde.js:283)
at e.consume (sp-webpart-workbench-assembly_en-us_c62a811b76aa07bcefefad77b22b5dde.js:283)
at e.consume (sp-webpart-workbench-assembly_en-us_c62a811b76aa07bcefefad77b22b5dde.js:283)
at e.consume (sp-webpart-workbench-assembly_en-us_c62a811b76aa07bcefefad77b22b5dde.js:283)
Create a new web part project with SharePoint Framework 1.4.1 and add MSGraphClient by this acrticle https://github.com/SharePoint/sp-dev-docs/blob/master/docs/spfx/use-msgraph.md
I've been having the same issue with the documentation mentioned above and with this tutorial https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aad-tutorial
Have you tried deploying the solution and not running it in the workbench. That worked for me.
That solved the problem. Thanks Wictor.
Yeah, we just need to deploy webpart to a site at first
There's an unfortunately known issue that Online workbench does not work regardless of the given permission s in the AAD application. We are working on getting this resolved. We'll also check if we can clarify that in the tutorial doc.
@VesaJuvonen any progress on this? Developing without the workbench to test Graph calls is quite the pain. And no rush, we're in preview :)
@aslanovsergey Thanks for bringing this issue to light. This issue has been fixed and will be made available in the next release.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Most helpful comment
@VesaJuvonen any progress on this? Developing without the workbench to test Graph calls is quite the pain. And no rush, we're in preview :)