The Case of the Blank SharePoint Page (and the Guest Who Couldn't See It)
SPFx web part and application customizer not loading for guest or external users, and the Public CDN fix TL;DR: Guests can't read your SPFx bundles from the app catalog, so the page renders blank. Enable the Public CDN with the */CLIENTSIDEASSETS origin (or grant the guest read on the app catalog), wait until it goes active, bump the version and redeploy the .sppkg , then retest as the guest in…
The story revolves around a SharePoint page that appears blank to guests, specifically those using Gmail. This issue occurs because the SPFx bundles, which include web parts and application customizers, cannot be loaded from the app catalog for external users. The SPFx solution includes both a web part and an application customizer for the page's header and footer.
The problem lies with the "CannotCreatePersonalSite: You do not have access to create this personal site" error message, which is a red herring as it happens to every guest on every page, not just those experiencing the blank page issue.
The real culprit is the Refused to execute script from URL because its MIME type (text/html) is not executable, and strict MIME type checking is enabled. This error explains why the browser is trying to access the web part's JavaScript and getting an "Access Denied" page instead. This issue arises since the .sppkg file contains its JavaScript bundles in the ClientSideAssets library, which is normally accessible to internal users but not to guests.
The solution involves enabling the Public CDN with the */CLIENTSIDEASSETS origin. Once enabled, the SPFx bundles can be served from the Public CDN, allowing guests to view the SharePoint page correctly. The steps to enable the Public CDN include connecting to the SharePoint service, checking the current state of the Public CDN, enabling it if it's not already active, adding the */CLIENTSIDEASSETS origin, waiting for the configuration to be pending, and then redeploying the .sppkg file.
Finally, bumping the version and redeploying the solution ensures that the asset URLs are updated, preventing the previous issue from reoccurring. Testing with a guest in an InPrivate window and disabling the cache confirms that the fix worked.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.