小编N1K*_*N1K的帖子

如何解决 next-auth 中的“getUserByAccount 不是函数”?

我已将 Nextjs 更新到最新版本,并按照文档的指定更新了 next-auth 和 prisma 适配器。

但是,当我尝试在应用程序中进行身份验证时,signIn我收到最新更新的以下错误:

[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR] 
https://next-auth.js.org/errors#oauth_callback_handler_error getUserByAccount is not a function {
  message: 'getUserByAccount is not a function',
  stack: 'TypeError: getUserByAccount is not a function\n' +
    '    at Object.callback (/home/.../node_modules/next-auth/core/routes/callback.js:81:39)\n' +
    '    at runMicrotasks (<anonymous>)\n' +
    '    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n' +
    '    at async NextAuthHandler (/home/.../node_modules/next-auth/core/index.js:103:28)\n' +
    '    at async NextAuthNextHandler (/home/.../node_modules/next-auth/next/index.js:40:7)\n' +
    '    at async [...]/node_modules/next-auth/next/index.js:80:32\n' +
    '    at async Object.apiResolver (/home/.../node_modules/next/dist/server/api-utils.js:102:9)\n' +
    '    at async DevServer.handleApiRequest (/home/.../node_modules/next/dist/server/next-server.js:1014:9)\n' +
    '    at async Object.fn …
Run Code Online (Sandbox Code Playgroud)

next.js prisma next-auth

9
推荐指数
1
解决办法
8297
查看次数

标签 统计

next-auth ×1

next.js ×1

prisma ×1