1

I have created my first web part following the steps in the Microsoft documentation tutorial. After struggling with many of the steps, I managed to get the web part up and running and added it to a site.

The problem arises when an external user accesses the site where it is hosted. In that case, they always get an error where the web part content should be. The error is similar to the following:

ERROR:
Script error for: 06d9a2a4-a115-42a4-93bd-6bd0f90a2d84_1.0.0.1
http://requirejs.org/docs/errors.html#scripterror

PILA DE LLAMADAS:
B@https://res-1.cdn.office.net/files/sp-client/sp-pages-assembly_es-es_cc3f3663db82945d7e631c8bf2029946.js line 70 > eval:8:252
onScriptError@https://res-1.cdn.office.net/files/sp-client/sp-pages-assembly_es-es_cc3f3663db82945d7e631c8bf2029946.js line 70 > eval:30:244

Initially, the error appeared in the WebPartStrings file, but I've removed all references to it from my code and now it's showing up in another place.

I understand that it must be some permission that external users do not have.

I have seen the following question in Microsoft's Q&A, which seems to be related, but when I follow the steps, the last step is not possible for me to do because that page gives me an error, and if I go to my own app catalog page, I don't see where to configure that permission.

Thank you in advance for your help.

4
  • Try granting Read permissions to external users on the app catalog site where you have deployed SPFx solution. Let me know if it works for you. Also, refer my answer here: sharepoint.stackexchange.com/questions/306601/…. You need SharePoint tenant administrator and App catalog site collection administrator (SCA) permissions for running the commands. Mar 30, 2023 at 14:02
  • 1
    Thank you! This solves the problem. Now I realise that my question was already answered. I don't know how I missed it.
    – lenko
    Mar 30, 2023 at 14:10
  • Great, glad it worked for you! Mar 30, 2023 at 14:14
  • I am checking to see how things are going there on this issue. Apr 6, 2023 at 6:00

1 Answer 1

0

This is a permissions related issue for external users. External users should have Read permissions on the app catalog site where you have deployed SPFx solution.

You have to grant permissions to All Users(membership) on app catalog site where your SPFx solution is deployed.

Follow below steps:

  1. Turn ON external sharing for your M365 tenant.

  2. Download & open SharePoint Online Management Shell and run below commands using administrator account:

    Connect-SPOService -Url https://<tenant>-admin.sharepoint.com
    Set-SPOTenant -ShowAllUsersClaim $true
    
  3. Grant "Read" permissions to All Users(membership) group on App Catalog (https://<tenant>-admin.sharepoint.com/sites/AppCatalogSite/_layouts/user.aspx) or on "Client Side Assets" library (https://<tenant>-admin.sharepoint.com/sites/AppCatalogSite/ClientSideAssets/AllItems.aspx) in App Catalog site as shown below:

    enter image description here

Note: You need SharePoint tenant administrator and App catalog site collection administrator (SCA) permissions for running the commands.

Reference: SPFx web part error for few users : Failed to load component

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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