Skip to content

Conversation

@seer-by-sentry
Copy link
Contributor

Fixes ECENCY-NEXT-WKD. The issue was that: Service worker cache invalidation failure due to dynamic build IDs and aggressive precaching of non-existent chunks.

  • Implements a ServiceWorkerManager component to handle service worker lifecycle and updates, ensuring new deployments are reflected by reloading the page.
  • Adds a custom service worker (custom-sw.js) to skip waiting and claim clients immediately upon activation, and to clean up old caches.
  • Sets up a global error handler to catch ChunkLoadError exceptions, which occur when the user has a stale service worker or cached HTML, and reloads the page to fetch the new version.
  • Configures next-pwa to use the custom service worker and customize runtime caching strategies, including network-first for JavaScript chunks to prevent stale chunk errors.

This fix was generated by Seer in Sentry, triggered automatically. 👁️ Run ID: 36327

Not quite right? Click here to continue debugging with Seer.

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.

1 participant