Hi there. Thanks for such a great library!
I hit an issue trying to use it for the first time, where queries worked but mutations would hang indefinitely, and never execute my actual procedure (function).
I managed to figure it out, but thought it might be worth documenting this more explicitly, to save others the hours of debugging.
The cause was that:
Mutation inputs come through the request body (whereas query string inputs come through the query string)
tRPC's Node HTTP adapter (which other adapters, like this Koa adapter I'm using, wrap) thus attempts to read/stream the request body
But I was already using another middleware to read/stream request bodies for other uses in my app.
So tRPC was indefinitely waiting around for data
and end
events that never came.
Fortunately, tRPC's Node HTTP adapter does support the native Node request already having a body
property set. And in my case, the other middleware I'm using does provide an option to add this property to the native Node request (in addition to the Koa context's request).
So consider documenting this important detail and gotcha, whether in the adapters page(s) and/or the troubleshooting page.
Thanks and hope this helps others!
No response
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too