OAuth callback error: Cannot read properties of undefined (reading 'findUnique') #11763
Unanswered
tayloraucoin
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Environment:
Describe the issue:
I am encountering a TypeError: Cannot read properties of undefined (reading 'findUnique') during the OAuth callback with Google. The error occurs specifically when attempting to retrieve the user by account after a successful OAuth callback.
Interestingly, my company has this same setup in a sister application. The versions are quite similar but not exact. However, this problem does not occur in that application. Here are the version details for both setups:
Ours:
Sister App:
The Prisma client is confirmed to be working elsewhere in the application. Additionally, the adapter in next-auth has a try-catch block that confirms its successful initialization.
What I’ve tried so far:
I’ve referenced this GitHub discussion which suggests using
@@map
in Prisma models to fix this issue. However, using@@map
renames the tables to lowercase, leading to case sensitivity issues with Prisma's operations.I’ve also followed the official Prisma setup documentation, but this error persists.
Models:
Error Logs:
Expected behavior:
The OAuth callback should correctly retrieve the user from the database using findUnique without throwing an error.
Beta Was this translation helpful? Give feedback.
All reactions