ruhroh
TTCTheo's Typesafe Cult
•Created by ruhroh on 5/21/2023 in #questions
Typescript error when trying to access more user properties in my JWT token
Hello! I am using Next Auth and I have it built so that users will also have a username, and in my auth file, my jwt callback looks like this:
Unfortunately, I am getting this TypeScript error:
Property 'username' does not exist on type 'User | AdapterUser'.
After looking into it, I found that the user type is defined in the node_modules folder, and this is what both User
and AdapterUser
looks like:
As you can see I've tried adding username to either or, and both, but I'm still getting the same error (after a ts server refresh too) and my app also will not build because of it. Any help would be appreciated. Thank you!4 replies
TTCTheo's Typesafe Cult
•Created by ruhroh on 11/13/2022 in #questions
How would you make requests to an Open API that follows traditional REST using t3 stack
Hello! I was wondering how I would go about fetching data from an open API that follows the traditional RESTful format using trpc. I would normally go about this with simple axios calls on the client, but I figured that might not be standard practice and wanted to get some insight on what would be the best way to make calls to an external api in the T3 stack.
25 replies
TTCTheo's Typesafe Cult
•Created by ruhroh on 10/22/2022 in #questions
Property 'useMutation' does not exist
Hello, I'm very new to T3 and pretty new to coding in general. Going through my first tutorial on youtube to build a simple application and it seems like there has been some small changes made recently in how you set up simple CRUD and I can't seem to figure it . Problem is simply that whenever I try to use tRPC's useMutation method here, it simply gives me an error saying that it "does not exist on type '{ useContext():..." despite following the tutorial.
6 replies