Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
None
What browser(s) / client(s) have you tested
Additional environment details
No response
Describe the bug / error
The SharePoint Service Worker (spserviceworker.js) intermittently blocks specific JavaScript assets hosted on a custom CDN, while other assets from the exact same CDN origin and path load without issue.
Disabling Service Workers entirely resolves the problem, which strongly suggests the issue lies in how the SP Service Worker intercepts and handles fetch requests.
Example:
We have two Web Parts whose resources are available in the same location on the CDN.
The first, profile_xxx_js, will be blocked, but the second, people_xxx.js, located in exactly the same place, will be allowed.
It is only after the Service Worker makes another attempt—without any user intervention—that the file will be loaded.


When Service Workers are disabled, the problem goes away.
When they are re-enabled, the problem reappears.

Steps to reproduce
- Load a SharePoint page that preloads multiple JS assets from a custom CDN (same origin, same path prefix, same version).
- Observe that some assets load correctly (HTTP 200 via ServiceWorker) while others fail with net::ERR_FAILED or CORS error.
- The failing asset eventually recovers and loads via the Service Worker after several retries — without any user action.
- Forcing a hard refresh (Ctrl+Shift+R) does not fix the issue.
- Disabling Service Workers in Chrome DevTools (Application > Service Workers > Bypass for network) makes all assets load correctly every time.
- Re-enabling Service Workers causes the issue to reappear.
Expected behavior
All assets from the same CDN origin should be handled consistently by the Service Worker — either all intercepted or all passed through, without arbitrary failures.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
None
What browser(s) / client(s) have you tested
Additional environment details
No response
Describe the bug / error
The SharePoint Service Worker (spserviceworker.js) intermittently blocks specific JavaScript assets hosted on a custom CDN, while other assets from the exact same CDN origin and path load without issue.
Disabling Service Workers entirely resolves the problem, which strongly suggests the issue lies in how the SP Service Worker intercepts and handles fetch requests.
Example:


We have two Web Parts whose resources are available in the same location on the CDN.
The first,
profile_xxx_js, will be blocked, but the second,people_xxx.js, located in exactly the same place, will be allowed.It is only after the Service Worker makes another attempt—without any user intervention—that the file will be loaded.
When Service Workers are disabled, the problem goes away.

When they are re-enabled, the problem reappears.
Steps to reproduce
Expected behavior
All assets from the same CDN origin should be handled consistently by the Service Worker — either all intercepted or all passed through, without arbitrary failures.