Mugetsu
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Mugetsu on 10/2/2024 in #questions
tRPC mutation onError handler error type for shared logic
Thanks ! Yeah i needed to assert the error type inside the handler and make error param of unknow type
5 replies
TTCTheo's Typesafe Cult
•Created by Mugetsu on 9/3/2024 in #questions
Use Zod schema after parse & transform as a new schema
Thanks @Jacob it helped me a lot with ur suggestions!
7 replies
TTCTheo's Typesafe Cult
•Created by Mugetsu on 9/9/2024 in #questions
New Zod schema based on an existing one, with some fields having different validation rules?
Well it seems to be working. Extend here seems better choice after playing with it as it need less z props through out. Thank you for suggestion ! ❤️
5 replies
TTCTheo's Typesafe Cult
•Created by Mugetsu on 9/3/2024 in #questions
Use Zod schema after parse & transform as a new schema
@Jacob yes, exactly.
7 replies
TTCTheo's Typesafe Cult
•Created by Mugetsu on 9/3/2024 in #questions
typescript object util library
Particularly I need to flatten keys of deeply nested objects to strings and being able to set/get/pick via string keys
9 replies
TTCTheo's Typesafe Cult
•Created by Mugetsu on 9/3/2024 in #questions
typescript object util library
Doesn’t seem like accessing object via “property.x.b.c” is basic language stuff.
My question might be misleading a little bit. I was referring to string dot notation keys. Sorry
9 replies
TTCTheo's Typesafe Cult
•Created by Mugetsu on 8/28/2024 in #questions
Use ReactQuery to fetch different api resource than trpc resource
Yeah. Exactly what I found just after posting the question 🤦♂️ nonetheless thanks for answering as its what I was asking for ! Thank you ❤️
5 replies
Controller is already closed crash
So after some digging I found that the fetch request inside the tRPC procedure is causing this error to happen. It's not clear to me why this happens but when I have such procedure
And I do manually refresh my app (browser refresh) fast enough multiple times in a row the query errors and then it throws
Invalid state: Controller is already closed
and crash the app. When I just remove the fetch call it never throws that controller error but I still can see enigmatic error for the query in the console.7 replies
TTCTheo's Typesafe Cult
•Created by Mugetsu on 1/9/2024 in #questions
Logging trpc errors in production
P.S.
Im using custom PINO logger and not deploying to vercel
4 replies
TTCTheo's Typesafe Cult
•Created by Mugetsu on 11/30/2023 in #questions
TRPC Server error handling?
my apology. Out of habit 🤦♂️
6 replies