Issue Tracker - Google Provider/Prisma Adapter issue

Hello, I am doing the issue tracker project and I’m stuck on adding the Prisma Adapter… I can get Google sign in page but when I try to login with an authorized user I get this long error. Any ideas?

[next-auth][error][adapter_error_getUserByAccount] https://next-auth.js.org/errors#adapter_error_getuserbyaccount Cannot read properties of undefined (reading 'findUnique') { message: "Cannot read properties of undefined (reading 'findUnique')", stack: "TypeError: Cannot read properties of undefined (reading 'findUnique')\n" + ' at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@next-auth/prisma-adapter/dist/index.js:222:45)\n' + ' at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)\n' + ' at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)\n' + ' at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)\n' + ' at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)\n' + ' at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)\n' + ' at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)\n' + ' at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)\n' + ' at new Promise (<anonymous>)\n' + ' at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)\n' + ' at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)\n' + ' at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)\n' + ' at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)\n' + ' at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)\n' + ' at async D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\compiled\\next-server\\app-route.runtime.dev.js:6:63809\n' + ' at async eU.execute (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\compiled\\next-server\\app-route.runtime.dev.js:6:53964)\n' + ' at async eU.handle (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\compiled\\next-server\\app-route.runtime.dev.js:6:65062)\n' + ' at async doRender (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\base-server.js:1333:42)\n' + ' at async cacheEntry.responseCache.get.routeKind (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\base-server.js:1543:40)\n' + ' at async DevServer.renderToResponseWithComponentsImpl (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\base-server.js:1463:28)\n' + ' at async DevServer.renderPageComponent (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\base-server.js:1856:24)\n' + ' at async DevServer.renderToResponseImpl (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\base-server.js:1894:32)\n' + ' at async DevServer.pipeImpl (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\base-server.js:911:25)\n' + ' at async NextNodeServer.handleCatchallRenderRequest (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\next-server.js:271:17)\n' + ' at async DevServer.handleRequestImpl (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\base-server.js:807:17)\n' + ' at async D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\dev\\next-dev-server.js:331:20\n' + ' at async Span.traceAsyncFn (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\trace\\trace.js:151:20)\n' + ' at async DevServer.handleRequest (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\dev\\next-dev-server.js:328:24)\n' + ' at async invokeRender (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\lib\\router-server.js:163:21)\n' + ' at async handleRequest (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\lib\\router-server.js:342:24)\n' + ' at async requestHandlerImpl (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\lib\\router-server.js:366:13)\n' + ' at async Server.requestListener (D:\\Programming_With_Mosh\\NextJS_Issue_Tracker\\issue-tracker\\node_modules\\next\\dist\\server\\lib\\start-server.js:140:13)', name: 'TypeError' } [next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR] https://next-auth.js.org/errors#oauth_callback_handler_error Cannot read properties of undefined (reading 'findUnique') TypeError: Cannot read properties of undefined (reading 'findUnique') at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@next-auth/prisma-adapter/dist/index.js:222:45) at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43) at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24) at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25) at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29) at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28) at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17) at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13) at new Promise (<anonymous>) at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16) at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49) at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38) at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30) at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24) at async D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:63809 at async eU.execute (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:53964) at async eU.handle (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:65062) at async doRender (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\base-server.js:1333:42) at async cacheEntry.responseCache.get.routeKind (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\base-server.js:1543:40) at async DevServer.renderToResponseWithComponentsImpl (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\base-server.js:1463:28) at async DevServer.renderPageComponent (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\base-server.js:1856:24) at async DevServer.renderToResponseImpl (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\base-server.js:1894:32) at async DevServer.pipeImpl (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\base-server.js:911:25) at async NextNodeServer.handleCatchallRenderRequest (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\next-server.js:271:17) at async DevServer.handleRequestImpl (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\base-server.js:807:17) at async D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\dev\next-dev-server.js:331:20 at async Span.traceAsyncFn (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\trace\trace.js:151:20) at async DevServer.handleRequest (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\dev\next-dev-server.js:328:24) at async invokeRender (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\lib\router-server.js:163:21) at async handleRequest (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\lib\router-server.js:342:24) at async requestHandlerImpl (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\lib\router-server.js:366:13) at async Server.requestListener (D:\Programming_With_Mosh\NextJS_Issue_Tracker\issue-tracker\node_modules\next\dist\server\lib\start-server.js:140:13) { name: 'GetUserByAccountError', code: undefined }

Issue resolved, I was mistakenly importing prisma via

import prisma from "@prisma/client"

instead of

import prisma from "@/prisma/client"

in my NextAuth handler function.

Wow, thank you so much, this was it