A unique Problem with SPFx Solution

Anonymous
2022-03-17T10:35:26.49+00:00

I have created a default SPFx extension with no custom code. I deployed it on the App Catalog and added it on the Site from the Site Content. The Extension works well when I log in using my company laptop but fails when I log in using a personal laptop.

I started an investigation and found that this is due the MIME Type. This error message is from the Chrome Console.

Refused to execute script from 'https://xxx.sharepoint.com/sites/AppCatalog/ClientSideAssets/xxxxxxxxxxxxxxx/MyMmtExtensionApplicationCustomizerStrings_en-us_9e4e260121b17b42d15c0d16c5238742.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Now, ClientSiteAssets is a hidden library where the reference of the SPFx on the pages deployed is used. So, basically, I tried to click the .js file and the below error appears. However, using my company device, this issue isn't there.

How do get this fixed now? I know that it could be from the Conditional Access Policy set by the organization but that should not stop my solution from working.

184108-image.png

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} vote

4 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
    2022-03-18T06:28:23.783+00:00

    Hi @Anonymous ,
    This issue might caused by limit access in your organization. Users on unmanaged devices will have browser-only access with no ability to download, print, or sync files. The following document might help
    https://learn.microsoft.com/en-us/sharepoint/control-access-from-unmanaged-devices?redirectSourcePath=%252fen-us%252farticle%252fControl-access-from-unmanaged-devices-5ae550c4-bd20-4257-847b-5c20fb053622


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  2. Anonymous
    2022-04-01T08:04:20.543+00:00

    @RaytheonXie_MSFT

    A solution has been found yet but I have created a ticket with MS. Hoping to see some solution by next week.

    Thanks
    Aniruddha

    0 comments No comments

  3. Anonymous
    2022-04-08T10:50:31.137+00:00

    So, we have to exclude two libraries to make the spfx work. There is a hidden library called ClientSideAsset in the AppCatalog and another one is the SiteAssets. The Conditional Access Rule can be removed using the PowerShell script.

    0 comments No comments

  4. accesa-svc-001 0 Reputation points
    2023-03-14T10:56:05.3766667+00:00

    @Anonymous can you please be more specific about how you managed to solve the problem? We are facing the same issue and a more detailed answer would be appreciated. Thanks !


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.