Skip to content

Fix service worker installation failure on Firefox#7755

Open
pranjalisr wants to merge 21 commits intowebpack:mainfrom
pranjalisr:fix/firefox-sw-install-clean
Open

Fix service worker installation failure on Firefox#7755
pranjalisr wants to merge 21 commits intowebpack:mainfrom
pranjalisr:fix/firefox-sw-install-clean

Conversation

@pranjalisr
Copy link
Contributor

@pranjalisr pranjalisr commented Jan 20, 2026

Summary
Fixes #7738
Fix SW install failure in Firefox by replacing cache.addAll() with Promise.allSettled() to prevent installation from failing due to individual precache errors. Also deduplicates manifest URLs before caching.


What kind of change does this PR introduce?

Code change


Did you add tests for your changes?

No.


Does this PR introduce a breaking change?

No.


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

No documentation changes are required.

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

@pranjalisr
Copy link
Contributor Author

@alexander-akait Just following up to kindly request a review of this PR when you have availability.
Thank you.

@alexander-akait
Copy link
Member

@evenstensberg Can you look at this and test, I think we can merge it

@vercel
Copy link

vercel bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Feb 22, 2026 6:23am

Request Review

@pranjalisr
Copy link
Contributor Author

Tested in Firefox using production build (yarn build + yarn serve-dist). Service worker installs successfully and no longer aborts on install.
Confirmed in Application → Service Workers that sw.js is running.

Screenshot 2026-02-13 at 16 43 13

@evenstensberg Can you please check this? If this sounds Ok then I will push the code changes.

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate the contribution. Code is not ideal, made a few suggestions :)

@pranjalisr
Copy link
Contributor Author

Made changes and re-ran locally on Firefox. It's running
Please review code if anything needs to be changed will do that accordingly

Screenshot 2026-02-15 at 22 38 02

ovflowd
ovflowd previously approved these changes Feb 16, 2026
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contrubution :)

src/sw.js Outdated
return url.href;
});

const allManifestURLs = [...manifest, ...otherManifest].map(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doubt it is a problem but lets filter out so we dont have duplicate urls before we access the cache

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you suggest? Should I make changes in allManifestURLs ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes just filter out dupes, easy to do if you convert it to a set and back to an array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made code changes as suggested. Checked locally, working fine on firefox browser.

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

4 participants