Skip to content
Discussion options

You must be logged in to vote

The behaviour you hit is deliberate, and the source comment names your exact case.

packages/react-router/lib/dom/ssr/single-fetch.tsx:

// If this error'd without hitting the running server, then bubble a normal
// `ErrorResponse` and don't try to decode the body with `turbo-stream`.
//
// This could be triggered by a few scenarios:
// - `.data` request 404 on a pre-rendered app using a CDN
// - 429 error returned from a CDN on a SSR app
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
  throw new ErrorResponseImpl(res.status, res.statusText, await res.text());
}

From the client's side a 429 from your Hono limiter is indistinguishable from a 429 from a CDN sitting in front …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xandris
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants