Property id is missing in type User on v4.24.12 (latest of writing) #13314
-
|
Using pre-commits via Husky and tsc-files, and I get the following error: src/app/api/auth/[...nextauth]/route.ts(27,19): error TS2322: Type '(rawCredentials: Record<"email" | "password", string> | undefined, _request: Pick<RequestInternal, "body" | "query" | "headers" | "method">) => Promise<...>' is not assignable to type '(credentials: Record<"email" | "password", string> | undefined, req: Pick<RequestInternal, "body" | "query" | "headers" | "method">) => Awaitable<...>'.
Type 'Promise<User | null>' is not assignable to type 'Awaitable<User | null>'.
Type 'Promise<User | null>' is not assignable to type 'PromiseLike<User | null>'.
Types of property 'then' are incompatible.
Type '<TResult1 = User | null, TResult2 = never>(onfulfilled?: ((value: User | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => Promise<...>' is not assignable to type '<TResult1 = User | null, TResult2 = never>(onfulfilled?: ((value: User | null) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => PromiseLike<...>'.
Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'import("/home/cyrus/Projects/collaborations/gym-site/src/server/database").User | null' is not assignable to type 'import("/home/cyrus/Projects/collaborations/gym-site/node_modules/next-auth/core/types").User | null'.
Property 'id' is missing in type 'import("/home/cyrus/Projects/collaborations/gym-site/src/server/database").User' but required in type 'import("/home/cyrus/Projects/collaborations/gym-site/node_modules/next-auth/core/types").User'.
husky - pre-commit script failed (code 1)I did attempt TypeScript module augmentation originally though as I'm new to it I may have made a mistake? I'm providing all relevant files, let me know if anything else is needed of me to help diagnose this: |
Beta Was this translation helpful? Give feedback.
Answered by
cyrus01337
Oct 30, 2025
Replies: 1 comment
-
|
Dunno what I changed but it resolved itself, nice. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
cyrus01337
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dunno what I changed but it resolved itself, nice.