From 4b778f2f8592ee3076fe55b57f2720f5dc8541d2 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Mon, 9 Mar 2026 14:59:30 +0100 Subject: [PATCH] fix(sdk): wrap useSearchParams in Suspense boundary for Next.js 15 Co-Authored-By: Claude Opus 4.6 --- admin-compliance/app/sdk/layout.tsx | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/admin-compliance/app/sdk/layout.tsx b/admin-compliance/app/sdk/layout.tsx index 3cd06dc..0188af2 100644 --- a/admin-compliance/app/sdk/layout.tsx +++ b/admin-compliance/app/sdk/layout.tsx @@ -219,14 +219,12 @@ function SDKInnerLayout({ children }: { children: React.ReactNode }) { } // ============================================================================= -// MAIN LAYOUT +// SDK ROOT WITH SEARCH PARAMS (client component that reads ?project=) // ============================================================================= -export default function SDKRootLayout({ - children, -}: { - children: React.ReactNode -}) { +import { Suspense } from 'react' + +function SDKRootWithParams({ children }: { children: React.ReactNode }) { const searchParams = useSearchParams() const projectId = searchParams.get('project') || undefined @@ -236,3 +234,19 @@ export default function SDKRootLayout({ ) } + +// ============================================================================= +// MAIN LAYOUT (wraps in Suspense for useSearchParams) +// ============================================================================= + +export default function SDKRootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + }> + {children} + + ) +}