fix(pages): handle stale lazy-loaded chunks gracefully
Add error boundaries for rejected route and shader imports. Reload once for stale route chunks and show a localized fallback when the retry also fails, while preserving the shader gradient fallback.
Description
This PR fixes blank pages caused by stale or unavailable lazy-loaded JavaScript chunks.
Route-level chunk failures now trigger one session-guarded page reload. If the chunk still cannot be loaded, users see a localized error card with a Reload button instead of a blank page.
The decorative ColorBends shader now fails gracefully and preserves its existing gradient fallback without reloading the page.
Type of Change
- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Refactoring (no functional changes)
- [ ] Documentation update
- [ ] CI / Build / Tooling
How Has This Been Tested?
- [ ]
make testpasses locally - [x] Manual testing (describe below)
Validation performed:
npm run typecheckfrompages/npm run buildfrompages/git diff --check- Verified route lazy-load failures are caught by the error boundary.
- Verified route chunk failures reload only once per browser session.
- Verified repeated failures display the localized fallback card.
- Verified the Reload button clears the session guard and retries.
- Verified shader chunk failures preserve the gradient fallback without reloading the page.
Checklist
- [ ] My code follows the project's coding style (
go fmt,go vet) - [x] I have performed a self-review of the code
- [ ] I have added tests that prove my fix is effective or my feature works
- [x] New and existing frontend checks pass locally
- [ ] I have updated the documentation accordingly (if applicable)
- [ ] I have signed the CLA
Related Issues
Closes #521
🔍 OpenCodeReview found 2 issue(s) in this PR.
- ✅ Successfully posted inline: 2 comment(s)