Sp-dev-docs: Consuming MSGraphClient. Cannot read property 'PROD_OAUTH_TOKEN_URL' of undefined

Created on 26 Feb 2018  路  8Comments  路  Source: SharePoint/sp-dev-docs

Category

Question
Bug

Expected or Desired Behavior

I added code from this documentation https://github.com/SharePoint/sp-dev-docs/blob/master/docs/spfx/use-msgraph.md

Observed Behavior

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)

Steps to Reproduce

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

docs spfx-general tracked bug-suspected

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 :)

All 8 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ken-harris picture ken-harris  路  3Comments

christianbueschi picture christianbueschi  路  3Comments

StfBauer picture StfBauer  路  3Comments

nanddeepn picture nanddeepn  路  3Comments

Ralms picture Ralms  路  3Comments