Skip to content

fix(stability): add Error Boundary to prevent full-page crashes#4091

Merged
tangly1024 merged 1 commit into
notionnext-org:mainfrom
gzhang33:fix/stability-error-boundary
May 23, 2026
Merged

fix(stability): add Error Boundary to prevent full-page crashes#4091
tangly1024 merged 1 commit into
notionnext-org:mainfrom
gzhang33:fix/stability-error-boundary

Conversation

@gzhang33
Copy link
Copy Markdown
Contributor

Summary

  • Add React import to lib/utils/errorHandler.js (fixes broken createErrorBoundary)
  • Wrap component tree with AppErrorBoundary in pages/_app.js

Problem

Multiple open issues report client-side crashes that crash the entire page (#2295, #3545, #3372). The root cause is third-party scripts (Mermaid, Live2D, Prism) mutating React-managed DOM. Adding an Error Boundary catches these errors and shows a fallback instead of a blank page.

Changed files

  • lib/utils/errorHandler.js — add missing React import
  • pages/_app.js — add AppErrorBoundary wrapping the app tree

Risks

  • Low: Error Boundary is purely additive — only activates on uncaught rendering errors
  • The fallback UI is minimal: error message + refresh button, inline styles only

Verification

yarn lint
yarn build
# To test: throw an error inside any component — should see fallback instead of blank page

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@tangly1024 tangly1024 merged commit ea6851e into notionnext-org:main May 23, 2026
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.

2 participants