如果我尝试使用Typescript将NextAuth集成到我的应用程序中,我会得到2个错误。一次在NextAuth和NextAuthOptions。
import NextAuth from "next-auth"
import { NextAuthOptions } from "next-auth"
import GoogleProvider from "next-auth/providers/google";
export const authOptions: NextAuthOptions = ({
providers: [
GoogleProvider({
clientId: `${process.env.GOOGLE_CLIENT_ID}`,
clientSecret: `${process.env.GOOGLE_CLIENT_SECRET}`,
})
]
})
const handler = NextAuth(authOptions)
export { handler as GET, handler as POST }
模块“next-auth”没有导出的成员“NextAuthOptions '. ts”(2305)
此表达式不可调用。类型“typeof import(“next-auth”)”没有调用签名。
1条答案
按热度按时间66bbxpm51#