SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 1k forks source link

App web parts unavailable to add to SP Pages unless the App is deployed to All sites. #9799

Open erobillard opened 2 months ago

erobillard commented 2 months ago

What type of issue is this?

Documentation issue / typo

What SharePoint development model, framework, SDK or API is this about?

SPFx Apps containing Web Parts

Target SharePoint environment

SharePoint Online

What browser(s) / client(s) have you tested

Additional environment details

MS Edge Version 126.0.2592.87 (Official build) (64-bit) Issue observed with PnP Modern Search (4.12.2), and expected to affect all solutions with WPs. Looking for additional instances of the issue to corroborate or refute its existence.

Issue description

On sites where (PnP Modern Search) web parts are installed as an App, they do not appear when adding web parts to the page. Existing custom web parts work and can be edited, but new ones cannot be added with the Add Web Part UI. However, if the package is deployed to "all sites" then all included web parts are available to add to any page on any site.

I believe this is a side effect of Microsoft eliminating the SharePoint App Store as it seemed to coincide with that July 1 change for all tenants. This may end up as something the PnP project has no control over to remedy, which would mean a "fix" to the documentation rather than the code base. To Reproduce Detailed steps to reproduce the behavior:

  1. Install PnP Modern Search to any tenant, do not select the option to deploy the app to all sites. If not prompted to accept requested Graph permissions, open the API approval page and accept all requested approvals related to the PnP Modern Search package.
  2. Open the settings icon on any SharePoint Site. Select Add an App. Select the PnP Modern Search app.
  3. Confirm that the app is installed by navigating to Site Contents.
  4. Open any Page in the Pages library. Edit the page. Add a web part to any section. Search for PnP. The results are an empty set.

Expected behavior

  1. Return to step 1 and now provision the app to All sites. Re-approve permissions requested as needed.
  2. Step 4 (above) will now work as expected.
Tanddant commented 2 months ago

We're seeing a ton of issues around deployment of web parts as well, from WebAPIPermissions not being granted, to the web parts just not showing up.