Codex
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Codex on 8/22/2024 in #questions
React Error
I am getting this error in an extremely simple page (using pages router)
I have no idea why it wants me to import React when in all my other pages (probably 30+) it doesn't ask me to.
I have tried restarting typescript server multiple times.
Note: The page runs perfectly and does not give any console errors I have no idea why it is detecting an error.
4 replies
TTCTheo's Typesafe Cult
•Created by Codex on 8/2/2024 in #questions
Next Auth Session
I want to use useSession() I want the callback to do a check on the url it is coming from (req.headers.host is ideal); however, I cannot access this information in the callback function.
A possible solution I have explored is to go to
/api/auth/[...nextauth].ts
and override it from there however the problem with this is that whenever I am making trpc requests I have to also manually override that one which makes me repeat unnecessary code. I was just wondering if there is a better way to go about this.
The part of the code I am referring to for the callbacks is the following:
Thank you in advance.1 replies
TTCTheo's Typesafe Cult
•Created by Codex on 4/9/2024 in #questions
trpc context not passed correctly
I will include my setup at the end. My problem is that I am using nextauth with database sessions and passing the session as context into the procedures; however, everything that I have added myself isn't being included in the context for some reason (user.id and user.role)
This is my session type I declared,
This is the session callback I am using.
The console.log is just to see what is happening where (I will include it at the end)
I will include the rest of the information in the next message as I reached the character limit.
3 replies
TTCTheo's Typesafe Cult
•Created by Codex on 1/15/2024 in #questions
Prisma ghost connections
1 replies
TTCTheo's Typesafe Cult
•Created by Codex on 9/18/2023 in #questions
Question about useQuery
I have a query set up like follows
and I want to refetch this data whenever accesses or timeAccess changes so I used a useEffect, but the problem is if I don't use
inside the useEffect it infinitely calls itself but this prevents it from grabbing the same information more than once even if the previousData is no longer the same.
anyone know of a better way to do this?
8 replies