-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected HTTP errors on _data calls cause blank routes without any caught errors #5418
Comments
Same problem with Remix and Cloudflare CDN Messages (Rate Limit, WAF etc.). How are WAF errors or Captchas to handle that the client receives via the data request (_data) ? Depending on the status code (>=500?) you might have to redirect to the complete html page to see the original message or the captcha? |
Hm, yeah this is tricky. The current behavior is as such because you can return anything from your loader, and as long as you don't throw that will make it through as loader data: export function loader() {
// This will make it to `useLoaderData`
return new Response('whatever you want', {
status: 500,
headers: {
'Content-Type': 'text/plain'
}
});
} Basically, we don't assume that 4xx/5xx should go to the ErrorBoundary - we let So, if you get a 5xx response from somewhere other than the My initial gut reaction is to add an Somewhat related, I have seen folks ask for all 4xx/5xx to be automatically categorized as errors. I don't love this idea because it breaks from |
This should be resolved by #6783 and available once |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
What version of Remix are you using?
1.12.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Force a route's _data request to fail with an HTTP error and a response that remix doesn't expect (e.g. some string). This could happen when there is something wrong with e.g. CDN, proxy or load balancer configuration, an error that is generated outside or remix's control. Then make a client side navigation to that route.
Here's a diff from base create-remix app with express server where I respond with an error from express handler: celebro/remix-http-error-example@3e644df
Expected Behavior
Remix should trigger ErrorBoundary with some generic error.
Actual Behavior
Remix renders an empty route, without any indication of an error.
The text was updated successfully, but these errors were encountered: