Skip to content

Conversation

@calaespi
Copy link

This PR implements the missing retry(), componentStack, and ownerStack props in the App Router's error.js component, enabling better error recovery and debugging capabilities.

Changes:

  • Modified packages/next/src/client/components/error-boundary.tsx to:
    • Expose retry method using startTransition and router.refresh().
    • Capture and pass componentStack and ownerStack from componentDidCatch.
  • Added Comprehensive E2E Test (test/e2e/app-dir/error-retry):
    • Verifies error recovery mechanism using retry().
    • Ensures componentStack is accessible in the error component.
    • Validates functionality in both development and production builds.

Verification:

  • pnpm test-dev-turbo test/e2e/app-dir/error-retry (Passed)
  • pnpm test-start-turbo test/e2e/app-dir/error-retry (Passed)

@nextjs-bot
Copy link
Collaborator

Allow CI Workflow Run

  • approve CI run for commit: 4ea4b79

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Feb 10, 2026

Allow CI Workflow Run

  • approve CI run for commit: 6969cbe

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Stale componentStack and ownerStack from a previous error persist in state and are displayed with a new error due to incomplete state clearing in the error boundary.

Fix on Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants