Skip to content

fix(pwa): recover from a chunk removed by a deploy - #102

Merged
ssalentin merged 1 commit into
mainfrom
fix/pwa-preload
Nov 7, 2026
Merged

ssalentin merged 1 commit into
mainfrom
fix/pwa-preload

Conversation

@ssalentin

Copy link
Copy Markdown
Owner

Deploys replace build/ with rsync --delete, so the hashed chunks of the previous build disappear. An app that stayed open (or an installed PWA resumed from cache) then fails with "Failed to fetch dynamically imported module" and stays broken until a manual reload.

  • Listen for Vite's vite:preloadError and reload once; a sessionStorage marker suppresses repeats within 60 seconds so a genuinely missing asset cannot cause a reload loop.
  • The event is dispatched by the Vite preload helper in the built chunks (verified in build/client/_app/immutable).

Separate infrastructure follow-up for SysAdmin: keep the previous build's _app/immutable files for a couple of deploys so open clients never lose them.

Checked: npm run check 0/0, npm test 455 passed, npm run build ok.

@ssalentin
ssalentin merged commit 943bab4 into main Nov 7, 2026
1 check passed
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