Skip to content

Conversation

@pranjalisr
Copy link
Contributor

Summary

This PR fixes a Firefox-specific issue where the service worker fails to install or register. Fixes #7738
Firefox aborts installation if any promise inside event.waitUntil() rejects.
The previous implementation used cache.addAll(), which can reject when a single precache request fails (e.g., /manifest.json, /app-shell/index.html, or a Workbox manifest entry).
As a result, the entire service worker installation failed on Firefox, even though it worked on Chrome.

This PR replaces cache.addAll() with defensive per-request caching so that failed precache requests no longer break the install event.


What kind of change does this PR introduce?

fix — Prevents service worker installation from failing on Firefox by using safe, per-request precaching.


Did you add tests for your changes?

No.
Service worker behavior differs between browsers and is not currently covered by automated tests in this repository.
This fix is isolated to the SW script and does not affect build output.


Does this PR introduce a breaking change?

No.
Chrome and other browsers behave exactly the same as before.
Only Firefox benefits from the more resilient install logic.


If relevant, what needs to be documented once your changes are merged or what have you already documented?

No documentation changes are required.
The service worker behavior is internal and this update does not modify public APIs or user-facing features.

@vercel
Copy link

vercel bot commented Jan 20, 2026

@pranjalisr is attempting to deploy a commit to the OpenJS Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service worker fails to install/register on Firefox

1 participant