Next.js Discord

Discord Forum

NextAuth Error: cannot read properties of undefined (reading 'session')

Unanswered
Carpenter wasp posted this in #help-forum
Open in Discord
Carpenter waspOP
I am new in this. so need some help
import './globals.css'
import { SessionProvider } from 'next-auth/react'

export default function App({Component, pageProps: {session, ...pageProps }
}) {
  return (
    <SessionProvider session={session}>
      <Component {...pageProps}/>
    </SessionProvider>
  )
}


This is the app/api/auth/[...nextauth]/route.js file how do it fix this i have installed nextauth i checked the package.json

1 Reply

downgrade to 4.22.1