Skip to content

SharePoint Service Worker selectively blocks custom CDN assets while other assets from same origin load fine #10848

@jbolliet-jint

Description

@jbolliet-jint

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.
Image
Image

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

Steps to reproduce

  1. Load a SharePoint page that preloads multiple JS assets from a custom CDN (same origin, same path prefix, same version).
  2. Observe that some assets load correctly (HTTP 200 via ServiceWorker) while others fail with net::ERR_FAILED or CORS error.
  3. The failing asset eventually recovers and loads via the Service Worker after several retries — without any user action.
  4. Forcing a hard refresh (Ctrl+Shift+R) does not fix the issue.
  5. Disabling Service Workers in Chrome DevTools (Application > Service Workers > Bypass for network) makes all assets load correctly every time.
  6. 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.

Metadata

Metadata

Assignees

Labels

area:cdnCategory: Office 365 Content Delivery Networksharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions