fix: add SessionProvider to fix useSession SSR crash
Some checks failed
Build & Deploy Dashboard / deploy (push) Failing after 1m2s
Some checks failed
Build & Deploy Dashboard / deploy (push) Failing after 1m2s
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
output: 'standalone',
|
||||
experimental: {
|
||||
missingSuspenseWithCSRBailout: false,
|
||||
},
|
||||
images: {
|
||||
remotePatterns: [
|
||||
{ protocol: 'https', hostname: '**' },
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Sidebar } from "@/components/layout/Sidebar";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default function DashboardLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="flex h-screen bg-[#080810] overflow-hidden">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
import { Providers } from "./providers";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Digital Home",
|
||||
@@ -16,7 +17,9 @@ export default function RootLayout({
|
||||
}>) {
|
||||
return (
|
||||
<html lang="ru" className="dark">
|
||||
<body style={{fontFamily: 'system-ui, -apple-system, sans-serif'}}>{children}</body>
|
||||
<body style={{fontFamily: 'system-ui, -apple-system, sans-serif'}}>
|
||||
<Providers>{children}</Providers>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
6
src/app/providers.tsx
Normal file
6
src/app/providers.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
"use client";
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
|
||||
export function Providers({ children }: { children: React.ReactNode }) {
|
||||
return <SessionProvider>{children}</SessionProvider>;
|
||||
}
|
||||
Reference in New Issue
Block a user