Open pikooli opened 2 years ago
I ran into this on windows as soon as Next-Auth was integrated
./components/Header.tsx:5:0 Module not found: Can't resolve 'next-auth/client' 3 | import Link from 'next/link'; 4 | import { useRouter } from 'next/router';
5 | import { signOut, useSession } from 'next-auth/client'; 6 | 7 | const Header: React.FC = () => { 8 | const router = useRouter();
Hey man did you read what I post ? I said to import from
import { useSession, signOut } from "next-auth/react"
I think Next-auth change the way it work.
https://github.com/nextauthjs/next-auth#add-react-hook
You have to replace the import with this :
So you got the session with this :
And you have to setup a session provider on the top component.