Guest user and display SPFX Web Part in SharePoint Online

Behavior
A user cannot display the web part and while loading SharePoint received the following message “Uncaught (in promise) LPC is not enabled for guest users.”.

This means the guest user does not have permission to load the WebPart assets.

If the user is a guest user, as SPFX Web Part will need to assign permission to "All Users(membership)":

  1. Open SharePoint Management Online Shell and run below command. It prompts for SharePoint Online tenant URL, enter URL (for example, https://yourtenant-admin.sharepoint.com) and then it prompts for credentials. Enter SharePoint Admin or Global Admin credentials to connect to the tenant. Connect-SPOService

  2. Once the connection is done, run below command Set-SPOTenant -ShowAllUsersClaim $true

  3. Now, SharePoint allows resolving a new group named “All Users (membership)”.

  4. Grant “Read” permissions to this group on “Client Side Assets” library in App Catalog site as shown below (/sites/AppCatalogSite/ClientSideAssets/AllItems.aspx):