open-code-review icon indicating copy to clipboard operation
open-code-review copied to clipboard

fix(pages): handle stale lazy-loaded chunks gracefully

Open amh1k opened this issue 4 months ago • 2 comments

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 test passes locally
  • [x] Manual testing (describe below)

Validation performed:

  • npm run typecheck from pages/
  • npm run build from pages/
  • 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

amh1k avatar Jul 27 '26 18:07 amh1k

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 27 '26 18:07 CLAassistant

🔍 OpenCodeReview found 2 issue(s) in this PR.

  • ✅ Successfully posted inline: 2 comment(s)

github-actions[bot] avatar Jul 27 '26 18:07 github-actions[bot]