RPC Type confusion
The RPC package has some unexpected behaviours and I'm hoping someone can give me some insight.
This is the return value of the API route (pic 1) and what it's shown as on the other end of RPC (pic 2)
3 Replies
Solved. This was related to a drizzle update, the id being number | bigint seemingly broke the types. adding
id as number
resolved this.If I remember correctly
You need to also check for error
In order to narrow the type
I think that this caused by that bigint can't be JSON.