mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(frontend): move Agentation dynamic import to client component
ssr: false in next/dynamic is not allowed in Server Components. Extract into a 'use client' wrapper component.
This commit is contained in:
@@ -12,13 +12,8 @@ import { Toaster } from "@/components/molecules/Toast/toaster";
|
||||
import { SetupAnalytics } from "@/services/analytics";
|
||||
import { VercelAnalyticsWrapper } from "@/services/analytics/VercelAnalyticsWrapper";
|
||||
import { environment } from "@/services/environment";
|
||||
import AgentationDevtool from "@/components/AgentationDevtool";
|
||||
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
const Agentation = dynamic(
|
||||
() => import("agentation").then((mod) => mod.Agentation),
|
||||
{ ssr: false },
|
||||
);
|
||||
import { headers } from "next/headers";
|
||||
|
||||
const isDev = environment.isDev();
|
||||
@@ -85,7 +80,9 @@ export default async function RootLayout({
|
||||
<Toaster />
|
||||
<CookieConsentBanner />
|
||||
{(isLocal || isDev) &&
|
||||
process.env.NEXT_PUBLIC_AGENTATION_DEVTOOL && <Agentation />}
|
||||
process.env.NEXT_PUBLIC_AGENTATION_DEVTOOL && (
|
||||
<AgentationDevtool />
|
||||
)}
|
||||
</Providers>
|
||||
</ErrorBoundary>
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
const Agentation = dynamic(
|
||||
() => import("agentation").then((mod) => mod.Agentation),
|
||||
{ ssr: false },
|
||||
);
|
||||
|
||||
export default function AgentationDevtool() {
|
||||
return <Agentation />;
|
||||
}
|
||||
Reference in New Issue
Block a user