Hi everyone, I recently upgraded a project from nextjs 14 to the new next 15 and since then i've been getting this error while trying to get the session from authjs anywhere in my appication. Here im current getting the session on the layout file and thats is what's causing this error. i'm using authjs v5
This is the code of my layout file where i'm getting the session:
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import { SessionProvider } from "next-auth/react";
import { auth } from "@/auth";
import "./globals.css";
import { Toaster } from "@/components/ui/sonner";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const session = await auth();
return (
<SessionProvider session={session}>
<html lang="en">
<body className={inter.className}>
<Toaster />
{children}
</body>
</html>
</SessionProvider>
);
}
Pls is there anything i can do to solve this error currently, or i should just stick to nextjs for now 14 while this issue is being fixed by authjs