Sébastien Morel
Sébastien Morel
Explore posts from servers
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
yes I know and understand that... just not really easy to provide something that would make sense. Any idea in the code of Hono where a ReadableByteStreamController.close would be done and not try /catch / handle ?
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
and the trace does not say exactly where it crashes so that does not help
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
I tried to force reproduce it by bombarding our staging env, I killed the container(s) without reproducing this ReadableStream error
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
it's when we have high volume traffic, not connect to resource exhaustion or anything. But we see a correlation with number of api calls
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
I can't reproduce it.
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
We tried to change the fetch implementation but nothing changed really same trace
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
I wonder if resource exhaustion could trigger something that would trigger that
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
it happened 10 times today in our prod
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
all is working fine locally
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
if only I could reproduce
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
and I can't reproduce it yet
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
I wonder if the culprit is not: https://github.com/honojs/node-server/blob/main/src/request.ts#L83 but I don't explain it
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
hey @Arjix I have a middleware that adds header to the response yes, and then I do that in the app
const response = await yoga.handleRequest(c.req.raw, {
env: c.env,
ctx: c,
})
response.headers.forEach((value, key) => {
c.res.headers.set(key, value)
})
c.res.headers.set('Vary', 'Accept-Encoding')

try {
return c.body(response.body!, response.status as ContentfulStatusCode)
} catch (error) { /**}
const response = await yoga.handleRequest(c.req.raw, {
env: c.env,
ctx: c,
})
response.headers.forEach((value, key) => {
c.res.headers.set(key, value)
})
c.res.headers.set('Vary', 'Accept-Encoding')

try {
return c.body(response.body!, response.status as ContentfulStatusCode)
} catch (error) { /**}
26 replies
HHono
Created by Sébastien Morel on 3/21/2025 in #help
Invalid state: ReadableStream is already closed
I know that this error, is usually associated with double read of a Response (.json(), .text()) etc. etc. but that's not the case here
26 replies