Next.js Discord

Discord Forum

next-auth SessionProvider giving a runtime error

Short-tailed Albatross posted this in #help-forum
Open in Discord
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: 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 />

not sure if it is a nextjs 13.4.19 issue

0 Replies