Describe the bug
Push notifications do not work in production because the service worker never finishes installing. The SW generated by @ducanh2912/next-pwa includes /_next/dynamic-css-manifest.json in its precache list, but that URL returns 404 in the Docker deployment. Workbox aborts the install step with:
bad-precaching-response :: [{"url":"https://<host>/_next/dynamic-css-manifest.json","status":404}]
Since the service worker remains stuck in “installing”, web push doesn’t initialize and notifications are broken.
To Reproduce
- Deploy SplitPro using the production docker/prod/compose.yml (image ossapps/splitpro:latest; Next.js standalone output).
- Open the app in Chrome and go to DevTools → Application → Service Workers.
- Register the SW (navigator.serviceWorker.register('/sw.js')) or reload the page.
- See console error:
bad-precaching-response for /_next/dynamic-css-manifest.json (404).
The SW never activates; push subscription cannot be established.
Expected behavior
- Service worker installs and activates without errors.
- Push notifications can be subscribed and delivered.
Screenshots
- Service worker remains stuck in “installing” (DevTools → Application → Service Workers).
App version
- Docker image: ossapps/splitpro:latest
- Next.js: 15.4.7 (standalone output)
- @ducanh2912/next-pwa: 10.2.9
- Build ID available if needed (/_next/static/<BUILD_ID>)
Desktop
OS: macOS
Browser: Chrome
Version: 141
Device: iPhone
OS: iOS 13
Browser: Safari (Mobile)
Version: iOS26
Additional context
Root cause: In Next.js standalone builds, /_next/dynamic-css-manifest.json exists on disk but is not routable; requests return 404. Because the SW precache includes this path, Workbox treats the 404 as a failure and aborts installation.
Workaround used: Manually edit /app/public/sw.js in the running container to remove the precache entry { url: "/_next/dynamic-css-manifest.json", ... }.
After removing it, the SW installs and push notifications work. This manual change is not persistent across image rebuilds.
Proposed fix: Exclude that path from precaching in next.config.js (next-pwa config), e.g.:
const withPWA = (await import('@ducanh2912/next-pwa')).default({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
buildExcludes: [/_next\/dynamic-css-manifest\.json$/],
});
With this exclusion, the generated service worker installs cleanly and push notifications work out of the box.
Describe the bug
Push notifications do not work in production because the service worker never finishes installing. The SW generated by @ducanh2912/next-pwa includes /_next/dynamic-css-manifest.json in its precache list, but that URL returns 404 in the Docker deployment. Workbox aborts the install step with:
bad-precaching-response :: [{"url":"https://<host>/_next/dynamic-css-manifest.json","status":404}]Since the service worker remains stuck in “installing”, web push doesn’t initialize and notifications are broken.
To Reproduce
bad-precaching-response for /_next/dynamic-css-manifest.json (404).The SW never activates; push subscription cannot be established.
Expected behavior
Screenshots
App version
Desktop
OS: macOS
Browser: Chrome
Version: 141
Device: iPhone
OS: iOS 13
Browser: Safari (Mobile)
Version: iOS26
Additional context
Root cause: In Next.js standalone builds, /_next/dynamic-css-manifest.json exists on disk but is not routable; requests return 404. Because the SW precache includes this path, Workbox treats the 404 as a failure and aborts installation.
Workaround used: Manually edit /app/public/sw.js in the running container to remove the precache entry { url: "/_next/dynamic-css-manifest.json", ... }.
After removing it, the SW installs and push notifications work. This manual change is not persistent across image rebuilds.
Proposed fix: Exclude that path from precaching in next.config.js (next-pwa config), e.g.:
With this exclusion, the generated service worker installs cleanly and push notifications work out of the box.