trpc/react not working on AWS

Everything works locally. When deployed to AWS (via sst.dev), trpc/react doesn't work. API is working (i can hit it via postman). It was working yesterday. Error: { "json": { "message": "Unexpected token % in JSON at position 0", "code": -32700, "data": { "code": "PARSE_ERROR", "httpStatus": 400, "zodError": null } } }
No description
14 Replies
Neto
Neto9mo ago
check the raw response its probably the bigger issue
shikishikichangchang
how do i check the raw response?
Neto
Neto9mo ago
the error is on the serialization
shikishikichangchang
im only using the default usequery 'hello' on the post router of the default create t3 app
Neto
Neto9mo ago
i think the sst console gives you the response but the issue isnt on trpc is on the response that was badly serialized
shikishikichangchang
i tried returning a string only and it still failed the sst console isn't giving me any 'issues' it worked on vercel
Neto
Neto9mo ago
The error is on the serialization Looks like the lambda is fucking things up
shikishikichangchang
looks like it fk how can i fix this my users cant even log in now what's crazier is it passes sometimes
rampa2510
rampa25109mo ago
Did you manage to solve it? I also want to deploy using sst and not rely on vercel
shikishikichangchang
It was an AWS lambda issue (their infra was failing) - it fixed itself
rampa2510
rampa25109mo ago
It fixed istself? so all you did was redeployed and it worked?
NotLuksus
NotLuksus9mo ago
Ran into a similar issues a while ago make sure to enable streaming on your lambda as the trpc client is batchLinkStreaming I believe Or switch it to the non streaming variant
rampa2510
rampa25109mo ago
Got it will try that
Want results from more Discord servers?
Add your server