SPFx Throws Error When Installed On Subsite

%3CLINGO-SUB%20id%3D%22lingo-sub-2607382%22%20slang%3D%22en-US%22%3ESPFx%20Throws%20Error%20When%20Installed%20On%20Subsite%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2607382%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20developed%20a%20web-part%20which%20works%20fine%20on%20root%20site%20collections%20but%20produces%20the%20following%20error%20when%20added%20to%20a%20page%20in%20a%20subsite.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EError%20details%3A%20Error%3A%20Error%20initializing%20application.%20Error%3A%20TypeError%3A%20Cannot%20read%20property%20'Content'%20of%20undefined%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOddly%2C%20the%20web-part%20displays%20fine%20when%20the%20page%20is%20in%20edit%20mode%2C%20but%20falls%20back%20to%20the%20error%20screen%20when%20published.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20was%20built%20in%20SPFx%20using%20the%20Office%20Ui%20Fabric%20and%20MS%20Graph.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20is%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

 

I have developed a web-part which works fine on root site collections but produces the following error when added to a page in a subsite.

 

Error details: Error: Error initializing application. Error: TypeError: Cannot read property 'Content' of undefined

 

Oddly, the web-part displays fine when the page is in edit mode, but falls back to the error screen when published.

 

It was built in SPFx using the Office Ui Fabric and MS Graph.

 

Any help is appreciated.

0 Replies