hykter
hykterβ€’5mo ago

TRPCClientError: Unable to transform response from server

Hi πŸ™‚ I've just started - so nothing more than boiler plate code but for some reason it doesn't work. As you can see in attached pic, browser is ok with serwer response I am using neflify funcs as my backend Any suggestions :)?
No description
1 Reply
hykter
hykterβ€’5mo ago
when I replace trpc with simple fetch query it works, 0 issues Solved. As a RPC noob I didnt know that "convention of structuring JSON responses with a data field for the response data and an optional error field is commonly referred to as the "JSON API" or "JSON-RPC" convention. It's a widely used pattern for organizing data in JSON responses, especially in APIs and RPC (Remote Procedure Call) systems where clear communication of both successful responses and errors is crucial." so stick to that format and it will work
{
"data": {
// Response data goes here
},
"error": null
}
{
"data": {
// Response data goes here
},
"error": null
}