question

UjwalaSable-2783 avatar image
0 Votes"
UjwalaSable-2783 asked MichaelHan-MSFT edited

Client Side Solution (SPFX) App Id mismatch in SharePoint Modern Teams site

Hi Folks,

I am facing App Id mismatch in SharePoint when global navigation is used for “Home” i.e. to route to the root site.

Scenario:

We have a SharePoint Modern team site wherein we have deployed two different app packages(.sppkg, spfx solutions) in tenant’s App Catalog.

->First App (SPFX solution) is added on the root site (abc.sharepoint.com)
-> Second App is added on the Site Page (abc.sharepoint.com/sitepages/xyz.aspx)

Issue:

When on the Site Page (abc.sharepoint.com/sitepages/xyz.aspx), using global navigation to go back to home/root site.

This action correctly routes to the root site but when I check the Client Side Assets on the root site, the App id of the second app (added on the Site Page) appears at the top.

All the images on the root site which are referenced from the ClientSideAssets (First App) appear broken.

It is of high concern if users are using global navigation to go back to Home to see webparts on the home page disappearing and broken images, it not an acceptable behavior.

Need help to resolve this problem.

FYI: This issue does not occur if page is refreshed.

Below is the screenshot of client side assets on the root site after using the global navigation feature.
80635-image.png


office-sharepoint-online
image.png (36.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jerryzy avatar image
0 Votes"
Jerryzy answered UjwalaSable-2783 commented

Hi @UjwalaSable-2783 ,

This is because of when redirecting to home page using the global navigation, the page is doing partial updates not a full refresh so that the client side assert reference will appear broken.

A workaround is to create a SPFX to add a navigatedEvent for the HomePage and do a full referesh to make it work:

Record page hit when SPA page transitioning in modern SharePoint sites

Thanks
Best Regards


If an Answer is helpful, please click "Accept Answer" and upvote it.
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.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Jerryzy ,

Thank you for your answer and sharing the link for detail information on this.

At first it looked like refreshing the page inside OnInit method of application customizer would resolve the issue. But in our application we are keeping track of number of hits of SharePoint Page. Refreshing the page just to get correct ClientSideAsset Id would register extra hit per user thus affecting the usage analytics report.

In that case shouldn't this be fixed from your end?

Your help will be much appreciated!


Best Regards






0 Votes 0 ·
MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered MichaelHan-MSFT edited

Hi @UjwalaSable-2783 ,

It's by default that the modern SharePoint supports partial loading, which significantly improves the SharePoint page performance.

You could use navigatedEvent listener to handle this, refer to this article for more: https://nanddeepnachanblogs.com/posts/2020-04-10-handle-navigation-in-sharepoint-framework-application-customizer/

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.