facebook / react · Issue No. 37561
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.
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>
}
next dev. This has reproduced with both Turbopack and webpack, most often around a slow initial compilation, HMR, or a full reload.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.
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.
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.
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.