Skip to content

Fix error type (Error -> unknown) - #235

Merged
bvaughn merged 3 commits into
mainfrom
issues/234
Jan 15, 2026
Merged

bvaughn merged 3 commits into
mainfrom
issues/234

Conversation

@bvaughn

@bvaughn bvaughn commented Jan 15, 2026

Copy link
Copy Markdown
Owner

Resolves #234

@vercel

vercel Bot commented Jan 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
react-error-boundary Ready Ready Preview Jan 15, 2026 10:29pm

@bvaughn
bvaughn merged commit 9aea72a into main Jan 15, 2026
6 checks passed
ldeveber added a commit to ldeveber/tab-count-snooze that referenced this pull request Jan 18, 2026
ldeveber added a commit to ldeveber/tab-count-snooze that referenced this pull request Jan 18, 2026
* bump corepack

* bump vitest and test utils

* bump biome (& fix/format)

* bump misc

* bump react-error-boundary & fixes

@see bvaughn/react-error-boundary#235
raineorshine added a commit to cybersemics/em that referenced this pull request Aug 31, 2026
react-error-boundary 6.1.0 widened `FallbackProps['error']` from `Error` to
`unknown` (bvaughn/react-error-boundary#235), so `ErrorFallback`'s hand-written
prop type no longer accepted what `ErrorBoundary` passes it and `tsc` failed.
Lint, Deploy Preview, Puppeteer, and BrowserStack were all red on that one
error; nothing else in the bump needed adapting.

The fallback is now typed `FC<FallbackProps>` and narrows the thrown value
rather than assuming it is an `Error`: the message comes from `getErrorMessage`,
newly exported in the same release, and the stack trace toggle is gated behind
`instanceof Error` so a thrown string or plain object no longer opens an empty
Details section.

Drops `componentStack`, which is not a member of `FallbackProps` and never has
been in v6 — `ErrorBoundary` reports the component stack through `onError`, not
to `FallbackComponent`. It was an optional prop that nothing ever passed,
rendering an empty `<pre>` on every error screen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
raineorshine added a commit to cybersemics/em that referenced this pull request Aug 31, 2026
* chore(deps): bump react-error-boundary from 6.0.2 to 6.1.3

Bumps [react-error-boundary](https://github.com/bvaughn/react-error-boundary) from 6.0.2 to 6.1.3.
- [Release notes](https://github.com/bvaughn/react-error-boundary/releases)
- [Commits](bvaughn/react-error-boundary@6.0.2...6.1.3)

---
updated-dependencies:
- dependency-name: react-error-boundary
  dependency-version: 6.1.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Type the error boundary fallback against an unknown error

react-error-boundary 6.1.0 widened `FallbackProps['error']` from `Error` to
`unknown` (bvaughn/react-error-boundary#235), so `ErrorFallback`'s hand-written
prop type no longer accepted what `ErrorBoundary` passes it and `tsc` failed.
Lint, Deploy Preview, Puppeteer, and BrowserStack were all red on that one
error; nothing else in the bump needed adapting.

The fallback is now typed `FC<FallbackProps>` and narrows the thrown value
rather than assuming it is an `Error`: the message comes from `getErrorMessage`,
newly exported in the same release, and the stack trace toggle is gated behind
`instanceof Error` so a thrown string or plain object no longer opens an empty
Details section.

Drops `componentStack`, which is not a member of `FallbackProps` and never has
been in v6 — `ErrorBoundary` reports the component stack through `onError`, not
to `FallbackComponent`. It was an optional prop that nothing ever passed,
rendering an empty `<pre>` on every error screen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raine Revere <raine@cybersemics.org>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 33d68c27 Deployed Jan 15, 2026 by vercel[bot]
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.

FallbackProps['error'] should be unknown, not Error

1 participant