Skip to content

382 add error boundary around lazy loaded routes#504

Open
codenerde wants to merge 3 commits into
CredenceOrg:mainfrom
codenerde:382-add-error-boundary-around-lazy-loaded-routes
Open

382 add error boundary around lazy loaded routes#504
codenerde wants to merge 3 commits into
CredenceOrg:mainfrom
codenerde:382-add-error-boundary-around-lazy-loaded-routes

Conversation

@codenerde

Copy link
Copy Markdown

Closes #382

codenerde and others added 3 commits June 29, 2026 21:16
- Detect chunk-load errors by analyzing error messages
- Show network-type ErrorState for chunk-load failures
- Maintain existing retry functionality
- Add comprehensive tests

Closes CredenceOrg#382

Co-authored-by: openhands <openhands@all-hands.dev>
Closes CredenceOrg#382

- Remove errorElement from root Route in App.tsx so chunk-load errors
  propagate to ErrorBoundary instead of being caught by RouteErrorPage
- Tighten isChunkLoadError detection: remove over-broad 'load' match,
  add precise patterns for Vite/Webpack chunk-load errors
- Add regression test verifying ErrorBoundary catches chunk-load errors
  from lazy-loaded routes and shows retry UI (connection issue + try again)
- Fix existing test error messages to not trigger chunk-load detection

User-visible impact: chunk-load failures (network blips, deploy
skew) now show a branded 'Connection issue' panel with a 'Try again'
button instead of a white screen or the generic route error page.
Previously some users were refreshing the page as a workaround;
the retry button makes this a one-click recovery.
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.

Add error boundary around lazy-loaded routes

1 participant