0

I tried to import

Provider

from the client and got this error

./pages/_app.js:2:0
Module not found: Package path ./client is not exported from package C:\Users\Asram EFT\Desktop\threejs-journey Lessons\Nextjs\fbclone-yt\node_modules\next-auth (see exports field in C:\Users\Asram EFT\Desktop\threejs-journey Lessons\Nextjs\fbclone-yt\node_modules\next-auth\package.json)
  1 | import "../styles/globals.css";
> 2 | import { Provider } from "next-auth/client";
  3 | 
  4 | function MyApp({ Component, pageProps }) {
  5 |   return (

https://nextjs.org/docs/messages/module-not-found

this my \node_modules\next-auth\package.JSON exports and I don't have any idea what this error is saying

 "exports": {
    ".": "./index.js",
    "./jwt": "./jwt/index.js",
    "./react": "./react/index.js",
    "./core": "./core/index.js",
    "./next": "./next/index.js",
    "./client/_utils": "./client/_utils.js",
    "./providers/*": "./providers/*.js"
  },
Azr.em
  • 83
  • 1
  • 11
  • Does this answer your question? [Module not found: Error: Package path ./client is not exported from package](https://stackoverflow.com/questions/70243476/module-not-found-error-package-path-client-is-not-exported-from-package) – juliomalves Feb 02 '22 at 07:55
  • well yes that was the answer but I dint get the FB login after changing it – Azr.em Feb 03 '22 at 12:17

1 Answers1

0

I changed client to React and it worked

import { SessionProvider } from "next-auth/react"

export default function App({
  Component,
  pageProps: { session, ...pageProps }
}) {
  return (
    // `session` comes from `getServerSideProps` or `getInitialProps`.
    // Avoids flickering/session loading on first load.
    <SessionProvider session={session}>
      <Component {...pageProps} />
    </SessionProvider>
  )
}

Visit for more details https://github.com/nextauthjs/next-auth/releases/tag/v4.0.0-beta.1 !

Azr.em
  • 83
  • 1
  • 11