我在 Next-Auth (4.24.6) 中收到以下代码片段的 typescript/eslint 错误。我该如何解决这个问题?
Unsafe assignment of an `any` value.eslint@typescript-eslint/no-unsafe-assignment
(alias) NextAuth(options: AuthOptions): any (+2 overloads)
import NextAuth
import NextAuth from "next-auth";
import { authOptions } from "@/server/auth";
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };
尝试更改导出:
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };
至:
export default NextAuth(authOptions);
因此您没有分配从 NextAuth 函数返回的值。