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} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
output: 'standalone',
|
output: 'standalone',
|
||||||
|
experimental: {
|
||||||
|
missingSuspenseWithCSRBailout: false,
|
||||||
|
},
|
||||||
images: {
|
images: {
|
||||||
remotePatterns: [
|
remotePatterns: [
|
||||||
{ protocol: 'https', hostname: '**' },
|
{ protocol: 'https', hostname: '**' },
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { Sidebar } from "@/components/layout/Sidebar";
|
import { Sidebar } from "@/components/layout/Sidebar";
|
||||||
|
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
export default function DashboardLayout({ children }: { children: React.ReactNode }) {
|
export default function DashboardLayout({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen bg-[#080810] overflow-hidden">
|
<div className="flex h-screen bg-[#080810] overflow-hidden">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
import { Providers } from "./providers";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Digital Home",
|
title: "Digital Home",
|
||||||
@@ -16,7 +17,9 @@ export default function RootLayout({
|
|||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html lang="ru" className="dark">
|
<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>
|
</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