[TRPCClientError]: Converting circular structure to JSON
I'm getting this error only in production (Vercel). I'm using tRPC, Supabase, Clerk. The website crashes right after login.
Browser error:
Application error: a server-side exception has occurred (see the server logs for more information).Vercel logs:
5 Replies
And sometimes I get this in server logs:
at a glance I'm guessing you're returning a complex object that tRPC can't serialize into JSON. More context: https://stackoverflow.com/questions/64735881/typeerror-converting-circular-structure-to-json-starting-at-object-with-con
Stack Overflow
TypeError: Converting circular structure to JSON --> starting at ob...
I am a nest.js beginner and I am trying to implement Axios with my code and this error occurs and I would like to fix it.
--> starting at object with constructor 'ClientRequest'
| pr...
In particular, you might be returning a Node Timeout object, which can be returned from a setTimeout function: https://stackoverflow.com/a/37777603/5502241
Stack Overflow
What exactly are Javascript Timeout objects?
Here's a link with some sample code.
http://jsfiddle.net/4djNt/2/
I assumed, until I started testing, that the return value of a setTimeout() would be some kind of browser object.
In fact it see...
Yes, but I didn't know where to start looking, especially since everything has been working fine for weeks without touching the code or anything around the code.
It's a deeper issue that occurs at this function
so I updated the code. It still gave me an error, but the error is just the ctx object that I passed, so we don't know what it actually is
For context, here's my
createTRPCContext
:
And supabase
is exported from:
Solution
idk what the issue was, but I recreated the setup and it works now