Repository navigation
fix: reload once when a deploy removed the page chunks (2.35.1) - #285
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
After 2.35.0 went live, a tab that was still running 2.34.1 (or the installed app's first launch) asked for
OverviewPage-D4KNwQfk.jsand got a 404. The service worker updates itself (autoUpdate,clientsClaim) andcleanupOutdatedCachesdeletes the previous build's chunks, Pages no longer serves them, andregisterSW.jsnever reloads the page. So the first lazy page opened after a deploy fails.main.tsxnow listens forvite:preloadErrorand reloads once onto the current build. A second failure within 60 seconds is left toChunkErrorBoundary's existing "Failed to load page" screen, so it cannot loop.Diff
frontend/src/main.tsx: the handler (14 lines).package.jsonfiles,pyproject.toml,__init__.py,uv.lock,api/README.md,docs/API.mdanddocs/DEPLOYMENT.md; CHANGELOG entry; the PWA note in.claude/rules/frontend.md.Verified
OverviewPage-D4KNwQfk.jsanswers 404; the live entryindex-DJGXTtYH.jsloadsOverviewPage-BiAkOT1v.js.GITHUB_PAGES=trueproduction build served withvite preview, the Overview chunk removed fromdistand the service worker cleared, then a client-side move to/overview:tsc -band the pre-commit hooks pass.Not verified
vite previewanswers a missing chunk with the HTML shell (200,text/html) where Pages answers 404. Both reject the dynamic import the same way.