You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type Error with next-auth and Next.js 14.2.3 during Build: Type 'OmitWithTag<typeof import(...)>' does not satisfy the constraint '{ [x: string]: never; }'#11768
Hello, I am experiencing an issue when trying to build my Next.js project using next-auth. Below are the environment details and the error I'm encountering.
Environment:
Next.js: 14.2.3
next-auth: 4.24.7
Problem Description:
When running the npm run build command, I receive the following type error:
.next/types/app/api/auth/[...nextauth]/route.ts:8:13 Type error:
Type 'OmitWithTag<typeof import("C:/cursos/JS/NextJS/farmancia-14/front/app/api/auth/[...nextauth]/route"),
"GET"|"DELETE"|"HEAD"|"OPTIONS"|"POST"|"PUT"|"PATCH"|"config"|"generateStaticParams"| ... 6more ... |"maxDuration", "">' does not satisfy the constraint '{ [x: string]: never; }'.
Property 'authOptions' is incompatible with index signature. Type '{ providers: OAuthConfig<GoogleProfile>[]; }' is not assignable to type 'never'.
Related Code:
Here is the code from the app/api/auth/[...nextauth]/route.ts file:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I am experiencing an issue when trying to build my Next.js project using
next-auth
. Below are the environment details and the error I'm encountering.Environment:
Problem Description:
When running the
npm run build
command, I receive the following type error:Related Code:
Here is the code from the
app/api/auth/[...nextauth]/route.ts
file:Steps Taken:
Question:
Has anyone encountered a similar issue or have suggestions on how to resolve this type error related to next-auth and Next.js?
Beta Was this translation helpful? Give feedback.
All reactions