How to: Resolve “Something went wrong” when adding an SPFx webpart to Microsoft Teams

Another issue with today’s efforts.

What was the issue

I created an SPFx webpart which was supposed to work in both SPO and Microsoft Teams. I could add to SPO sites and it worked fine. I clicked on “Sync to Teams” and although I wasn’t seeing the “successfully synced teams solution” fly out message, I wasn’t getting any errors either. However, as soon as I tried to add it to a specific Channel in Microsoft Teams, I was getting an error message saying “Something went wrong”.

What did I try

I changed the GUIDs and the names of the web part and the solution and changed the version number too, in case there was something wrong with the build. I rebuilt and deployed again, but no cigar.

What was the actual problem

It seems that for an SPFx solution to be deployed to Microsoft Teams, you have to make sure you select “y” to ensure that your web part is automatically deployed tenant-wide when it’s added to the tenant App Catalog. This happens during scaffolding, it’s one of the questions Yeoman asks.

What was the actual solution

I had to make a slight change to my package-solution.json file to enable the webpart to be deployed tenant-wide when it’s added to the App Catalogue. Add the following line immediately after the configuration value includeClientSideAssets:

"skipFeatureDeployment": true,
skipFeatureDeployment Configuration in SPFx Web Part

Add “skipFeatureDeployment”: true, to your package-solution.json file.

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.