[英]Module not found: Package path ./client is not exported from package error in Next auth
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这是我的 \node_modules\next-auth\package.JSON 导出,我不知道这个错误在说什么
"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"
},
I changed client to React and it worked我将客户端更改为 React 并且它有效
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 !更多详情请访问https://github.com/nextauthjs/next-auth/releases/tag/v4.0.0-beta.1 !
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.