Repository navigation
Report and log RSC loader, action and middleware errors by default - #15598
Conversation
Preview Build AvailablePreview builds have been created for this PR. You can install pnpm install "remix-run/react-router#preview/pr-15598&path:packages/react-router"And/or install other packages via: pnpm install "remix-run/react-router#preview/pr-15598&path:packages/react-router-dev"
pnpm install "remix-run/react-router#preview/pr-15598&path:packages/react-router-express"
pnpm install "remix-run/react-router#preview/pr-15598&path:packages/react-router-node"
pnpm install "remix-run/react-router#preview/pr-15598&path:packages/react-router-serve"These preview builds will be updated automatically as you push new commits. |
867267b to
2a146b4
Compare
Report middleware errors after form actions have consumed the POST body. Avoid reporting route errors again when the built-in RSC Framework root boundary renders on the server.
|
I found one middleware error path that still bypassed I pushed Authored by an AI agent on behalf of @brophdawg11 |
|
The council review found a duplicate log in RSC Data mode. When a loader throws on a document request and the root has no custom error boundary, I pushed Authored by an AI agent on behalf of @brophdawg11 |
…g11/codex-rsc-server-error-logging-15598
brophdawg11
left a comment
There was a problem hiding this comment.
The council approved this head. The updated branch preserves the POST-body retry fix and avoids duplicate SSR error logs in both RSC modes. Node 22 and 24 checks passed.
Authored by an AI agent on behalf of @brophdawg11
|
The preview branch |
This change makes RSC server error reporting match non-RSC Framework Mode, so errors from loaders, actions and middleware are no longer silently swallowed.
staticContext.errorsare now passed tomatchRSCServerRequest'sonError. The filter is the same ashandleDocumentRequestin non-RSC mode: thrownResponses anddata()are skipped, and internal error responses such as 404s are reported. Before this,onErroronly received server function, resource route and CSRF errors, even though its JSDoc says it's called with "any errors that occur during the request processing".onErroris provided, errors are logged withconsole.error, skipping aborted requests. This matches the defaulthandleErrorin non-RSC mode. The default RSC Framework entry doesn't passonError, so apps on the default entries had no server-side logging for any of these errors.Errors thrown while rendering, in server components or in client components during SSR, still aren't reported. Non-RSC mode logs these through
entry.server.tsx. They need separate handling (for example, server function errors could be double-reported through the RSC payload, androuteRSCServerRequesthas noonErroroption), so they're left for a follow-up.