Hello,
I am facing an issue since early last week with SharePoint Framework solutions (Web Parts and Application Customizers) which are often loading from an incorrect CDN.
On one single O365 tenant, I have 2 separate site collections with a dedicated App Catalog for each of the site collections. Let's call these sites PROD and UAT. On these two site collections, I have my SPFx solution deployed there. PROD is on version N, the UAT is on version N+1. Basically, one site collection serves as QA/UAT to test updates before publishing it on the "production" site collection.
What has been notice is that we have the client side assets from one site collection being used on the other, despite being deployed to two distinct CDN URLs. It can happen in one direction or another.
I initially thought there was a deployment issue or something similar, but everything was good on that side.
Finally, I was able to reproduce the full issue with a brand new SPFx project I scaffolded from scratch while investigating this issue.
I have created two brand new site collections, SiteA and SiteB, and added the site collection app catalogs.
I have then created a basic SPFx 1.23.2 WebPart with React using Yeoman. I have left almost everything as generated, excepted skipFeatureDeployment which as been set to false . As opposed to the main real-life solution which uses external CDN, I will use includeClientSiteAssets: true to deploy to SharePoint client side assets folder since the issue also occurs with such settings.
I have used the build task to produce the SPPKG for this webpart, which I deployed to SiteA and added the Web Part on a site page. => It shows up correctly.
I have then updated the package-solution.json to increment the version to 2.0.0.0 and made a text modification in the React component to be able to differentiate it from the previous version.
I have used the build task to produce the newer SPPKG, which I then deployed to SiteB and added the Web Part on a site page.
At this point, I can face two scenarios:
- Either SiteB immediately shows up the Web Part in its old version 1.0.0.0 that was never deployed on that collection and the network trace shows that JS files are loaded from
/sites/SiteA/ClientSideAssets/.... instead of /sites/SiteB/.... , or
- SiteB shows the correct up-to-date Web Part in its version 2.0.0.0, and a page reload on the SiteA will show the same updated Web Part, with network trace showing that JS are loaded from /sites/SiteB/ClientSideAssets/.... instead of /sites/SiteA/....
I can do a browser cache clear/refresh, and it can solve the issue until the other site collection is being accessed and an incorrect source of JS files is used again.
This whole logic and way of deploying versioned packages in dedicated site collections was working perfectly fine for the past few years, I am not sure why this is getting scrambled since a few days.
Also, this issue is not limited to one specific tenant.
If anyone has some insights or ideas to share, I would be grateful. Thank you.