nbelyh / diagram-frame

SharePoint SPFx web part to display Visio diagrams.
https://unmanagedvisio.com/products/diagram-frame-sharepoint-visio-web-part/
MIT License
12 stars 5 forks source link

External user gets error when trying to open the diagram #10

Closed nbelyh closed 1 year ago

nbelyh commented 1 year ago

The normal file viewer shows the diagram properly. The users can access the files.

[SPLoaderError.loadComponentError]:

Failed to load component "eaf98c51-0b5e-4ab0-9eca-139671d32cf5" (DiagramFrameWebPart). Original error: Failed to load path dependency "VisioEmbed" from component "eaf98c51-0b5e-4ab0-9eca-139671d32cf5" (DiagramFrameWebPart). 
Original error: Error loading https://component-id.invalid/eaf98c51-0b5e-4ab0-9eca-139671d32cf5_1.1.518/VisioEmbed

    Unable to load script https://xxxx.sharepoint.com/sites/appcatalog/ClientSideAssets/bc8110d6-2d34-408e-98c5-7f32eab887cb/VisioEmbed_ccd8741a4a94e352df480c03932c34e6.js

INNER ERROR:

Failed to load path dependency "VisioEmbed" from component "eaf98c51-0b5e-4ab0-9eca-139671d32cf5" (DiagramFrameWebPart). 
Original error: Error loading https://component-id.invalid/eaf98c51-0b5e-4ab0-9eca-139671d32cf5_1.1.518/VisioEmbed

    Unable to load script https://xxxx.sharepoint.com/sites/appcatalog/ClientSideAssets/bc8110d6-2d34-408e-98c5-7f32eab887cb/VisioEmbed_ccd8741a4a94e352df480c03932c34e6.js

CALLSTACK:

/sp-pages-assembly_en-us_a9e2d3d0797b2c18fb68f25a6d44b260.js:70:540641
/files/sp-client/sp-pages-assembly_en-us_a9e2d3d0797b2c18fb68f25a6d44b260.js:70:799098
/files/sp-client/sp-pages-assembly_en-us_a9e2d3d0797b2c18fb68f25a6d44b260.js:70:836407
/files/sp-client/sp-pages-assembly_en-us_a9e2d3d0797b2c18fb68f25a6d44b260.js:70:832498
/files/sp-client/chunk.systemjs-component-loader_en-us_c9d296eaa8490acee6b3.js:1:6036`
nbelyh commented 1 year ago

Could it be the issue with providing SPFx web part hosted directly from your organization's App Catalog to external users in general

If you’re not using CDN with your SPFx webparts, most likely they’re hosted from your app catalog’s SiteAssets/ClientSideAssets library. If you have external users accessing your site, they won’t by default be able to access this site at all, and will hence encounter weird issues with the SPFx webparts.

Reference: https://www.koskila.net/failed-to-load-component-original-error-failed-to-load-path-dependency-contosospfxwebpartlocalization-from-component-guid-contosospfxwebpart/

How to enable your external users to access your SPFx webparts that are not hosted on CDN: Enable the CDN and re-deploy the app there How to fix Office 365 CDN if it breaks? Modify the ClientSideAssets -library’s permissions in the app catalog site to allow external users access there. This includes at least the following steps. Enable external sharing on your tenant if it isn’t enabled already. Enable external sharing on the App Catalog site Invite a group with your external/guest users to the ClientSideAssets library as visitors/readers.

Another reference, how to enable hosting of SPFx web parts from AppCatalog for guests: https://www.crowcanyon.help/article/431/

nbelyh commented 1 year ago

The new version 1.2 this is resolved, it is using CDN (jsdelivr). This eliminates the dependency on the user infrastructure. There is still a self-contained build created under releases that would not use CDN.