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
}
}
}
14 Replies
check the raw response
its probably the bigger issue
how do i check the raw response?
the error is on the serialization
im only using the default usequery 'hello' on the post router of the default create t3 app
i think the sst console gives you the response
but the issue isnt on trpc
is on the response that was badly serialized
i tried returning a string only
and it still failed
the sst console isn't giving me any 'issues'
it worked on vercel
The error is on the serialization
Looks like the lambda is fucking things up
looks like it
fk how can i fix this
my users cant even log in now
what's crazier is
it passes sometimes
Did you manage to solve it? I also want to deploy using sst and not rely on vercel
It was an AWS lambda issue (their infra was failing) - it fixed itself
It fixed istself? so all you did was redeployed and it worked?
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
Got it will try that