0

Today I tested some of my apps created with SharePoint framework and they started to show a errors in the webparts and extensions that use MSGraphClient. Before it was working normally.

I am importing the MSGraphClient from sp-client-preview and I get the similar error bellow on more than one tenant.

(***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).). Original error: {3} 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

Is there any update occurring in Microsoft SharePoint online servers?

  • Please checkout official docs - it's not in preview anymore. They released SPFx 1.6 update in September with some changes, I'm not sure if it affects you or not – Sergei Sergeev Nov 7 '18 at 16:00
  • i checked but there is step that we have to use this following method :this.context.msGraphClientFactory. The msGraphClientFactory does not exist. Am i missing something? – Snmr Nov 7 '18 at 18:23
0

Your webpart use the older SPFX version and you dont have this.context.msGraphClientFactory added in the last version for fix this you have two solution :

  • 1st and not the best : Update SPFX on your webpart Microsft Doc for update but i try this solution and its a lot of pain :)
  • Best solution: update yoeman generator, create a new webpart and add your older code inside the new
  • I updated my project following this article blog.mastykarz.nl/… and i was able import msgraph, but now i getting the following error: error TS5055: Cannot write file 'filename.d.ts' because it would overwrite input file. I searched for the possible cause but without result. – Snmr Nov 9 '18 at 13:53
  • Its why i prefer create a new webpart and add my older code inside , whith this project update process you need to edit manually some files in your project and doesnt work all times . – Tioger Nov 10 '18 at 8:27
0

Upgrade to SPFX 1.6 and use this line to import library:

import { MSGraphClient } from '@microsoft/sp-http';

Same question posted in Technet forum:

strange error in webparts and extensions that use MSGraphClient

  • I updated my project following this article blog.mastykarz.nl/… and i was able import msgraph, but now i getting the following error: error TS5055: Cannot write file 'filename.d.ts' because it would overwrite input file. – Snmr Nov 9 '18 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.