Unable to consume MSGraphClient object from ‘sp-client-preview’ module
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?
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.
Thanks, we will try this.
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.
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