next.js
cb2ec79d - Run render error reporting outside the work-unit scope (#101597)

Commit
22 days ago
Run render error reporting outside the work-unit scope (#101597) ## Summary With Cache Components and Partial Prefetching, timestamp reads in `onRequestError` can interrupt staged rendering and produce a secondary prerender diagnostic from the reporter. Run error reporting outside the work-unit scope so reporters can read time and randomness, including in async continuations. - Update both shared React error handlers in `create-error-handler.tsx`, covering RSC and SSR errors. - Add the `on-request-error-render-scope` regression fixture, checking original-error reporting and the absence of secondary diagnostics with Partial Prefetching enabled and disabled. - Audit the remaining hook callers, instrumentation docs, examples, upgrade guidance, and diagnostics; no other content needs changing. Repeated render-pass reports are unchanged. Lost delivery to an error tracker remains unverified. Finding: https://next-maintainer-agent.vercel.tools/agent-feedback/5036 ## Verification - The regression fails on unmodified canary with the reporter's `Date.now()` prerender diagnostic. All four cases pass with the fix in Turbopack development and production and Webpack production. - `pnpm test-start-webpack test/e2e/app-dir/on-request-error-render-scope test/e2e/on-request-error/basic` — 15 passed, including existing Node and Edge hook coverage. - `pnpm typescript`; focused Prettier and ESLint checks passed. - Hosted deployment validation not run. <!-- NEXT_JS_LLM -->
Author
Parents
Loading