You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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!
Link to related docs
No response
Additional information
No response
👨👧👦 Contributing
🙋♂️ Yes, I'd be down to file a PR implementing the suggested changes!
Funding
You can sponsor this specific effort via a Polar.sh pledge below
We receive the pledge once the issue is completed & verified
The text was updated successfully, but these errors were encountered:
Area of Improvement
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
andend
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!
Link to related docs
No response
Additional information
No response
👨👧👦 Contributing
Funding
The text was updated successfully, but these errors were encountered: