H
Hono8mo ago
Chev

tRPC subscriptions throw net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK) with httpSubscriptionLink

When using the Hono middleware as per the instructions, and setting up a tRPC subscription, the following error is thrown in console and a loop is created that eventually leads to a memory leak at the server:
net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
I don't see this with the equivalent Node http server. Is anyone else using tRPC subscriptions successfully with Hono? Repo here to reproduce: https://github.com/samuelgoldenbaum/honojs-middleware-issues-717
2 Replies
Chev
ChevOP3mo ago
Nobody experiencing the same or using trpc?
ambergristle
ambergristle3mo ago
it doesn't seem to be that popular in Hono land. i imagine there are advantages over Hono RPC, but for many cases the latter does just fine i'm on the train rn so i can't pull + run your repro repo yet but i would probably start here:
onCreate: publicProcedure.subscription(async function* (opts) {
for await (const [data] of on(eventEmitter, EVENT.CREATE)) {
const widget = data as Widget
yield widget
}
})
onCreate: publicProcedure.subscription(async function* (opts) {
for await (const [data] of on(eventEmitter, EVENT.CREATE)) {
const widget = data as Widget
yield widget
}
})
the error reads like the response is getting cut off, or is malformed have you tried adding a retryLink?

Did you find this page helpful?