feat: add route-segment error boundaries for isolated widget failure … - #657
Open
onyemaechiezekiel9 wants to merge 1 commit into
Open
Conversation
Contributor
|
Thanks for picking this up, @onyemaechiezekiel9 — this is assigned to you via the GrantFox bot for issue #593. Before this can be merged, all required CI checks need to pass. Currently failing:
Currently passing:
Please push a fix and make sure the full CI suite is green — I'll take another look once it is. Thanks for the contribution! |
Contributor
|
👋 Thanks for the submission! This PR currently has one or more failing CI checks. Per the GrantFox review process, PRs need all checks green before they can be merged — please take a look at the Checks tab (or run I'll take another look once everything is passing. Thanks for your patience! |
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.
Fix Issue #593: Add Route-Segment-Level Error Boundaries
Summary
Implements granular error boundaries across 10 critical route segments to prevent application-wide crashes when individual widgets or features fail. Errors are now isolated to their segment scope, keeping the shared layout, navbar, and sidebar fully interactive.
closes #593
Problem
Previously, errors in data-fetching segments (dashboard, marketplace, analytics, etc.) could crash the entire application or disable navigation. Users had no way to recover from segment-specific failures without a full page reload.
Solution
Added Next.js App Router error boundaries at the segment level for all dynamic/data-fetching routes:
Implementation Details
Error Boundary Pattern
Each boundary:
'use client'directive (required for error boundaries)ErrorPagePropsinterfaceErrorFallbackcomponent for consistent UXlogError()utilityreset()to re-render the segmentAccessibility
role="alert"witharia-live="assertive"for screen readersError Details Visibility
Files Added
src/app/*/error.tsx)src/app/*/error.test.tsx)ERROR_BOUNDARIES_SUMMARY.mdTesting
Run all tests with:
npm run test