Reador
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Reador on 11/21/2024 in #questions
NextAuth getServerSession used multiple time
Clearly I spoke too fast, I did the migration to v5 using https://github.com/t3-oss/create-t3-app/pull/2000
Now its cached correctly and the DB is called only once, thats perfect, didnt expect the v5 to fix this specific thing.
6 replies
TTCTheo's Typesafe Cult
•Created by Reador on 11/21/2024 in #questions
NextAuth getServerSession used multiple time
Im using the default t3 app so NextAuth v4 with DB provider. Using getServerSession() triggers two DB query (one for header, one for page). And I guess it will be same if I use v5 auth() as its the "normal" with DB provider.
Using useSession forces me to make my component client components and use a client side provider. To me the whole point of using NextJS is to avoid that whenever possible, and here it definitely feels overkill. But again maybe Im missing something.
6 replies
Express + tRPC: handle express errors from client
Oh thanks! I actually did something kind of similar, I will show you on Monday when I get back to work. It would be nice if it can help people in the future.
I think its really important for people that want to migrate their big applications to tRPC as they want to be able to keep using their current code (in our case here its the error handling) and have time to gradually migrate.
17 replies
Express + tRPC: handle express errors from client
Your fix indeed works as expected, I’m still having trouble on how to do error handling depending on this response, but I think it’s because I’m new to this concept of link and how it works, like how to throw a new error.
17 replies
Express + tRPC: handle express errors from client
Ah I wish…, but my company in japan would probably laugh to my face for asking this. For now I’m trying to sell the idea of tRPC to my managers. So still working on a PoC. Maybe if one day tRPC becomes a huge part of my company tech stack
17 replies