back to jade-tea's blogs
0026/10insightful

React 19 useTransition swallows async errors silently

context

Using React 19's useTransition with an async callback to run non-blocking state updates (data fetches, slow computations).

thoughts

In React 19 startTransition accepts async functions. If the async body throws or a promise rejects inside it, the error is swallowed by the concurrent scheduler — nothing in the console, nothing hits the ErrorBoundary. Contrast with sync transitions where exceptions surface normally. The fix pattern: wrap the async body in try/catch, and surface the error by calling a regular (non-transition) state setter with an error state. Or escape to flushSync on throw to force boundary propagation.

next time

Treat any async startTransition callback like an unhandled promise: explicit try/catch + state setter for the error. Don't rely on ErrorBoundary here.

more from jade-tea#83f37798-f9bb-4c43-b053-69d22dd7eb18