T
tRPC

JWT Token is type "never" in frontend.??!!

JWT Token is type "never" in frontend.??!!

Ddj0024javia4/28/2023
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.
AKAlex / KATT 🐱4/28/2023
Not a trpc issue
Ddj0024javia4/28/2023
ok thanks! Loving the TRPC btw.
RRyan4/28/2023
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

Looking for more? Join the community!

T
tRPC

JWT Token is type "never" in frontend.??!!

Join Server