SharePoint / SharePoint/sp-dev-docs
SharePoint Service Worker selectively blocks custom CDN assets while other assets from same origin load fine
@Ashlesha-MSFT is already working on this.
Since May 21, 2026.
- Dominant language
- PowerShell
- Stars
- 1.4k
- Forks
- 1.1k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 12
Description
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
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.