Getting this error when I wrap inside .
[ Server ] Error: Route "/" used headers().get('Host'). headers() should be awaited before using its value. Learn more: Nextjs
layout.tsx
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<ConvexAuthNextjsServerProvider>
<html lang="en">
<body>
<JotaiProvider>
{children}
</JotaiProvider>
</body>
</html>
</ConvexAuthNextjsServerProvider>
);
}
Basically its saying that headers is a dynamic api and it should be called asynchronously. It was working in Nextjs14 but not now in 15 it is. Although I can still work on the project but this error comes up in console every time I refresh or open it. The official documentation of convex is also not updated yet