trpc output dates are typed as strings and not dates
I'm using superjson as a transformer. When I query my data, it shows that fields that should be dates are typed as strings. How can I get them to be typed as dates?
6 Replies
Have you set it up on both the server and the client?
Yes.
client
server
If it helps, I have a Next13 app using the app router. I don't believe @trpc/next works on the app router, so I'm using '@trpc/react-query'
Well that should be enough, though not sure if there are any weirdnesses in AppRouter or NextJS as I'm not a big user of those
Make sure you've restarted your language server
I have the same problem using electron-trpc
I tried superjson transformer recently with the App router Next.js. It worked for me. Giving a reproducible repo will help much to solve this issue.
Yes I have solved it with
superjson