构建nextjs应用程序期间,Next-auth失败

jhkqcmku  于 2023-02-04  发布在  其他
关注(0)|答案(1)|浏览(149)

我在我的nextjs应用程序中使用next-auth。
npm install和npm run dev工作正常,并且本地身份验证也正常工作,但是当我运行build命令时,我得到了这个错误消息:

./node_modules/next-auth/next/index.d.ts:18:61
Type error: '>' expected.

  16 | export declare function unstable_getServerSession<O extends GetServerSessionOptions, R = O["callbacks"] extends {
  17 |     session: (...args: any[]) => infer U;
> 18 | } ? U : Session>(...args: Parameters<typeof getServerSession<O, R>>): ReturnType<typeof getServerSession<O, R>>;
     |                                                             ^
  19 | declare global {
  20 |     namespace NodeJS {
  21 |         interface ProcessEnv

我在package.json外观中的依赖项是:

"dependencies": {
    "@prisma/client": "^4.6.1",
    "next": "13.0.2",
    "next-auth": "^4.3.3",
    "next-transpile-modules": "^10.0.0",
    "nodemailer": "^6.9.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-markdown": "8.0.0",
    "ts-node": "^10.9.1"
},

4小时前我在网上搜索到的唯一的东西就是这个bug-report,会不会是next-auth的bug?
谢谢你帮忙。
我尝试使用不同版本的nextjs和next-auth,但没有任何变化。

qhhrdooz

qhhrdooz1#

从下一个身份验证的主要开发人员处获得信息:
通过此PR发布修复程序:https://github.com/nextauthjs/next-auth/pull/6595- 4.19.2不应该再有这个问题了!

相关问题