sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Unable to consume MSGraphClient object from ‘sp-client-preview’ module

Open MRuimerman opened this issue 8 years ago • 4 comments

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

When we try to consume MSGraphClient object from ‘sp-client-preview’ module in SharePoint Framework Application Customizer extension, the extension is not loaded and we are getting an error since today.

Observed Behavior

Error we are getting in the developer tools:

Error: ***Failed to load component "4d5eb168-6729-49a8-aec7-0e397f486b6e" (SPClientPreview). Original error: ***loadComponent() returned an empty object for component "4d5eb168-6729-49a8-aec7-0e397f486b6e" (SPClientPreview). at t [as constructor] (listview-host-assembly_default_e755154cda130cbe2be1b4ac2da90def.js:77) at new t (listview-host-assembly_default_e755154cda130cbe2be1b4ac2da90def.js:342) at Function.e.buildErrorWithVerboseLog (listview-host-assembly_default_e755154cda130cbe2be1b4ac2da90def.js:342) at Function.e.buildLoadComponentError (listview-host-assembly_default_e755154cda130cbe2be1b4ac2da90def.js:342) at listview-host-assembly_default_e755154cda130cbe2be1b4ac2da90def.js:342

Does anyone else has similar problems or know a solution for this?

MRuimerman avatar Nov 07 '18 14:11 MRuimerman

Got the problem two days ago, don't use sp-client-preview for graph but sp-http and check that page on how to use MsGraphClient (https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-msgraph) There are some changes on how to get the MSgraphClient.

BraunJonathan avatar Nov 07 '18 15:11 BraunJonathan

Thanks, we will try this.

MRuimerman avatar Nov 08 '18 09:11 MRuimerman

Yes, as @BraunJonathan mentioned, you need to consume MsGraphClient from the sp-http package. It was marked as beta originally in sp-client-preview, and then beta + deprecated in 1.6, and has now been removed.

patmill avatar Nov 08 '18 23:11 patmill

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

msft-github-bot avatar Jan 26 '20 06:01 msft-github-bot