Skip to content

fix: add error boundaries to prevent full app crashes (#1270)#1344

Open
abu-abdullah22 wants to merge 1 commit into
RocketChat:developfrom
abu-abdullah22:fix/react-error-boundaries-1270
Open

fix: add error boundaries to prevent full app crashes (#1270)#1344
abu-abdullah22 wants to merge 1 commit into
RocketChat:developfrom
abu-abdullah22:fix/react-error-boundaries-1270

Conversation

@abu-abdullah22

Copy link
Copy Markdown

Fixes #1270

Summary

Adds React Error Boundaries to prevent single-component errors from crashing
the entire embedded chat widget.

Changes

  • New ErrorBoundary component (packages/react/src/views/ErrorBoundary/)
    with a fallback UI (retry + reload) using the app's existing Box, Button,
    and Icon components from @embeddedchat/ui-elements
  • Wrapped the root EmbeddedChat component so any unhandled error shows the
    fallback instead of a blank screen
  • Wrapped ChatBody and ChatInput separately inside ChatLayout so an
    error in one doesn't take down the other
  • Added a changeset (patch, @embeddedchat/react)
  • Added ErrorBoundary.test.js using @testing-library/react

Note for reviewers

packages/react currently has jest as a dependency but no working Jest
config/test script wired up — running npx jest fails with
"Cannot use import statement outside a module" since Babel isn't connected
to Jest's transform pipeline. I added the test file following existing
testing-library patterns used elsewhere in the codebase, but couldn't verify
it runs locally due to this pre-existing gap. Happy to add a jest.config.js

  • babel-jest setup as a follow-up if you'd like it in scope here.

@CLAassistant

CLAassistant commented Jul 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Missing React Error Boundaries - Application crashes on component errors

2 participants