Bug: RSC performance track measures negative end time for aborted or errored components
React version: React Server Components client bundled with Next.js 16.3.3 (19.3.0-canary-cbb046ab-20260731); the same unguarded code is present on React main as of 2026-09-09.
Steps To Reproduce
- Render an async App Router Server Component that can terminate via
redirect()before it produces children. A representative component is:
async function AuthenticatedAdminShell({ children }) {
const isAuthenticated = await checkSession()
if (!isAuthenticated) redirect("/sign-in")
return <AdminShell>{children}</AdminShell>
}- Run the app with
next dev. This has reproduced with both Turbopack and webpack, most often around a slow initial compilation, HMR, or a full reload. - Navigate to the guarded route so the component redirects, is rejected, or is aborted before child timing information is recorded.
Link to code example: https://github.com/vercel/next.js/issues/86060
The Next.js issue contains a runnable reproduction repository and reports for notFound(), redirect(), dynamic routes, and auth-guarded admin routes. I reproduced the same failure on macOS arm64 with Next.js 16.3.3, React/React DOM 19.2.8, Node 24, webpack dev mode, and Chromium 151.0.7922.34:
Uncaught TypeError: Failed to execute 'measure' on 'Performance': 'AuthenticatedAdminShell' cannot have a negative time stamp.The current behavior
flushComponentPerformance can call logComponentErrored or logComponentAborted while childrenEndTime is still the -Infinity sentinel (or otherwise negative after translating the server time origin). Both functions call:
performance.measure(measureName, {
start: startTime < 0 ? 0 : startTime,
end: childrenEndTime,
// ...
})The browser rejects the negative end timestamp, creating an unrelated runtime error and, in some cases, a development error overlay. The zero-width prefix in the measure name comes from React's Server Component performance track.
logComponentRender already has the necessary validation:
if (supportsUserTiming && childrenEndTime >= 0 && trackIdx < 10) {But logComponentAborted and logComponentErrored currently only check supportsUserTiming.
A proposed Next.js patch identified these same two missing checks, but was closed because the source fix belongs in React: https://github.com/vercel/next.js/pull/88688
I applied the equivalent guard locally to the four React Server DOM development clients bundled by Next.js:
-if (supportsUserTiming) {
+if (supportsUserTiming && childrenEndTime >= 0) {After reinstalling and restarting the dev server, three isolated /admin → /sign-in browser runs completed with no invalid measures, page errors, or Next.js error overlay.
The expected behavior
Development performance instrumentation should not call performance.measure() with a negative end timestamp. Rejected and aborted Server Components should preserve their actual redirect/error behavior without producing a secondary profiler exception.
I am preparing a source-level regression test and fix for packages/react-client/src/ReactFlightPerformanceTrack.js.
Source: facebook/react