Module not found: Error: Package path ./client is not exported from package
It seems next-auth/client
was renamed to next-auth/react
in v4
:
https://github.com/nextauthjs/next-auth/releases/tag/v4.0.0-beta.1
Along with next-auth/react, Provide
was renamed to SessionProvider
. It should be as follows,
import { SessionProvider } from "next-auth/react"
export default function App({
Component,
pageProps: { session, ...pageProps },
}) {
return (
<SessionProvider session={session} refetchInterval={5 * 60}>
<Component {...pageProps} />
</SessionProvider>
)
}
https://next-auth.js.org/getting-started/upgrade-v4
i think you should use "next-auth": "^3.29.0", this version of next-auth