JWT Token is type "never" in frontend.??!!
TRPC Backend is sending JWT Token as string but frontend is reading it as type "never".
I am using transformer: superjson on both BE and FE.
if i typecast it manually "as string" then it shows correct type.
Can someone please confirm if this is an issue or not?
Environment -> Node 16.
3 Replies
Not a trpc issue
ok thanks! Loving the TRPC btw.
TS can't infer what type of data is in your JWT. You could use Zod to validate the fields you expect and then infer the type from Zod