next-auth SessionProvider giving a runtime error
Unanswered
Short-tailed Albatross posted this in #help-forum
Short-tailed AlbatrossOP
this is the error on localhost:3000
Unhandled Runtime Error
Error: React Context is unavailable in Server Components
this is the client component for context.
"use client ";
export { SessionProvider as default } from "next-auth/react";
this is the root layout
xport default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={inter.className}>
<SessionProvider >
<Navbar />
<main className="p-4 max-w-7xl m-auto min-w-min">{children}</main>
<Footer />
</SessionProvider>
</body>
</html>
);
}
not sure if it is a nextjs 13.4.19 issue
Unhandled Runtime Error
Error: React Context is unavailable in Server Components
this is the client component for context.
"use client ";
export { SessionProvider as default } from "next-auth/react";
this is the root layout
xport default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={inter.className}>
<SessionProvider >
<Navbar />
<main className="p-4 max-w-7xl m-auto min-w-min">{children}</main>
<Footer />
</SessionProvider>
</body>
</html>
);
}
not sure if it is a nextjs 13.4.19 issue