You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/components/ErrorBoundary exists as a directory but the component inside it is not wired into the App Router layout. If an unhandled error occurs (e.g. a corrupted ScVal crashes the XDR parser mid-render), the entire page goes blank in production with no user-facing explanation and no automatic error report.
Expected Behaviour
The global error boundary catches render errors anywhere in the tree, shows a branded recovery screen with a Try Again button that triggers reset(), and optionally reports the error to Sentry (or another error tracker) using NEXT_PUBLIC_SENTRY_DSN.
Acceptance Criteria
src/app/error.tsx created (the Next.js App Router error boundary convention) with 'use client' directive, error prop, and reset prop
The component renders the SmartDrop logo, the message "Something went wrong", a tidy error code derived from error.digest, a Try Again button (onClick={reset}), and a Go Home link
If NEXT_PUBLIC_SENTRY_DSN is set in the environment, @sentry/nextjs is initialised and Sentry.captureException(error) is called inside a useEffect in the error boundary
src/app/global-error.tsx handles root layout crashes (Chakra provider itself crashing) — it renders a minimal plain-HTML recovery page that does not depend on Chakra
The existing src/components/ErrorBoundary class component is audited — if it is already used as a per-route boundary, its onError callback is wired to Sentry as well
A Playwright test navigates to /farm, injects a render error via page.evaluate, and asserts the "Something went wrong" recovery screen appears and the Try Again button re-renders the farm page
Problem
src/components/ErrorBoundaryexists as a directory but the component inside it is not wired into the App Router layout. If an unhandled error occurs (e.g. a corruptedScValcrashes the XDR parser mid-render), the entire page goes blank in production with no user-facing explanation and no automatic error report.Expected Behaviour
The global error boundary catches render errors anywhere in the tree, shows a branded recovery screen with a Try Again button that triggers
reset(), and optionally reports the error to Sentry (or another error tracker) usingNEXT_PUBLIC_SENTRY_DSN.Acceptance Criteria
src/app/error.tsxcreated (the Next.js App Router error boundary convention) with'use client'directive,errorprop, andresetproperror.digest, a Try Again button (onClick={reset}), and a Go Home linkNEXT_PUBLIC_SENTRY_DSNis set in the environment,@sentry/nextjsis initialised andSentry.captureException(error)is called inside auseEffectin the error boundarysrc/app/global-error.tsxhandles root layout crashes (Chakra provider itself crashing) — it renders a minimal plain-HTML recovery page that does not depend on Chakrasrc/components/ErrorBoundaryclass component is audited — if it is already used as a per-route boundary, itsonErrorcallback is wired to Sentry as well/farm, injects a render error viapage.evaluate, and asserts the "Something went wrong" recovery screen appears and the Try Again button re-renders the farm pageRelevant Files
src/app/error.tsx— create (Next.js App Router convention)src/app/global-error.tsx— createsrc/components/ErrorBoundary/— audit and wire to Sentrynext.config.ts— Sentry webpack plugin (optional, behind env flag)