Loader errors render the root ErrorBoundary but no stack trace appears in deployment logs
0 reputation · 14 May 2024, 13:30 UTC
500 response with ErrorBoundary, but empty logs
On a Remix app deployed behind a serverless platform, a thrown loader error renders the root ErrorBoundary and returns a 500, yet the platform's function logs show nothing about the exception. The goal is to reliably capture the original stack trace for every loader/action failure in production.
Uncertainty
Remix itself does not log thrown errors automatically; the adapter's createRequestHandler is responsible for surfacing them. It is unclear whether the missing logs mean the server entry point is not forwarding errors, or whether the deployment replaced or misconfigured the adapter handler. There is also the streaming case: with defer, a rejected deferred loader arrives as a 200 with the error boundary inside the stream, so the failure may never appear as an error status at all.
Questions
- Where in the request lifecycle should errors be captured so that both non-streaming and streaming failures reach the platform logs with the original stack?
- How can request IDs from CDN and function logs be correlated to match a 500 HTML response to the real exception?
- How to verify that a deliberate throw in a loader produces a stack trace in the hosting platform's log viewer rather than only the rendered ErrorBoundary?
Assume Remix v2 with a custom entry.server; exact behavior should be confirmed against the installed version.