Skip to content

Add scoped error.tsx and loading.tsx/Suspense boundaries across all routes #29

Closed

Description

@chonilius

Problem

src/app/not-found.tsx exists as the catch-all 404, but there's no visible evidence of route-level or global error.tsx boundaries anywhere in src/app/** (the file listing shows no error.tsx, global-error.tsx, or loading.tsx files at all). In Next.js App Router, without an error.tsx in a route segment, an unhandled render-time exception (e.g. a null-pointer from unexpectedly missing data, a bug in one of the adapter functions surfacing a TypeError, a Client Component in IssueActions.tsx throwing during a wallet interaction) bubbles up and either triggers Next's default unstyled error screen (jarring, off-brand, and in production shows a generic message with no recovery path) or, worse, without any loading.tsx files, every Server Component data fetch blocks the full page render with no streaming/skeleton state, meaning a slow backend response (or the cache: "no-store" fetches discussed elsewhere in this batch) produces a blank white screen for the full fetch duration on every navigation, which is especially bad on the data-heavy dashboard routes.

Why this is hard

  • This is a systematic gap across every route segment, not a single missing file — you need to determine, per route (/, /issues, /issues/[id], /milestones, /connect, /dashboard/*, /reputation/[handle], /auth/callback), what a good error and loading experience looks like given that route's specific data dependencies and failure modes, rather than copy-pasting one generic boundary everywhere.
  • error.tsx boundaries are Client Components by Next.js requirement and only catch errors in their own segment's rendering (not in a parent layout or sibling segment) — correctly scoping boundaries (global vs. per-route) requires understanding the actual layout nesting in src/app/layout.tsx and each route group, and a wrong placement leaves gaps where errors still escape to the default screen.
  • loading.tsx files enable streaming SSR (React Suspense boundaries automatically inserted by Next.js per segment) — but if a route's Server Component does multiple sequential/parallel fetches (see the dashboard waterfall issue in this batch), a naive single loading.tsx per route gives an all-or-nothing skeleton rather than progressively streaming in sections as their data resolves, which requires actually restructuring the component tree with nested <Suspense> boundaries around independently-loading sections, not just dropping in a loading.tsx file.
  • Error boundaries need to distinguish recoverable errors (show a retry button that re-triggers the Server Component fetch, e.g. via a client-side router.refresh()) from the fact that fetchWithFallback-based routes should rarely even reach an error boundary (they fall back to mock data) — meaning error.tsx boundaries are primarily a safety net for genuine bugs/exceptions, and their design should reflect that (a clear "something went wrong, here's what to do" rather than implying the whole feature is down).

Scope

  • Add appropriately-scoped error.tsx boundaries for each major route segment with on-brand styling matching the dark-mode-first design system and a working retry action.
  • Add a global-error.tsx as the outermost safety net.
  • Add loading.tsx/nested <Suspense> skeleton states for every data-fetching route, with skeletons that streams in progressively for multi-fetch dashboard routes rather than blocking on the slowest fetch.
  • Verify streaming behavior with an artificially slowed/mocked backend response to confirm progressive rendering actually occurs.

Acceptance criteria

  • Throwing a test exception in each route segment's Server or Client Component is caught by an on-brand error boundary with a working retry, not the default Next.js error screen.
  • Every data-fetching route shows a skeleton/loading state immediately on navigation instead of a blank screen, verified under artificial network delay.

Activity

  1. added
    very hard
    architecture
    bug
    on Jul 15, 2026
  2. added
    GrantFox OSS
    Maybe Rewarded
    Official Campaign | FWC26
    on Jul 15, 2026
  3. added
    Stellar Wave
    on Aug 25, 2026
  4. oldtaker24 commented on Aug 25, 2026

    @oldtaker24
    Contributor

    @oldtaker24 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    i will like to work on this issues

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @oldtaker24 to this issue.

  5. drips-wave commented on Aug 25, 2026

    @drips-wave

    Congratulations, @oldtaker24! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @oldtaker24: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  6. drips-wave commented on Aug 25, 2026

    @drips-wave

    This issue has been completed by @oldtaker24 as part of the Stellar Wave Program's 8th Wave 🥳

    😎 @oldtaker24: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  7. removed
    Stellar Wave
    on Oct 15, 2026
  8. added
    Stellar Wave
    on Oct 15, 2026
  9. removed
    Stellar Wave
    on Oct 15, 2026
  10. added
    Stellar Wave
    on Oct 15, 2026
  11. removed
    Stellar Wave
    on Oct 15, 2026
  12. added
    Stellar Wave
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSMaybe RewardedOfficial Campaign | FWC26Stellar Wavearchitecturebugvery hard

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions