fix(sdk): wrap useSearchParams in Suspense boundary for Next.js 15
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Failing after 35s
CI / test-python-backend-compliance (push) Successful in 34s
CI / test-python-document-crawler (push) Successful in 22s
CI / test-python-dsms-gateway (push) Successful in 19s
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Failing after 35s
CI / test-python-backend-compliance (push) Successful in 34s
CI / test-python-document-crawler (push) Successful in 22s
CI / test-python-dsms-gateway (push) Successful in 19s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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({
|
import { Suspense } from 'react'
|
||||||
children,
|
|
||||||
}: {
|
function SDKRootWithParams({ children }: { children: React.ReactNode }) {
|
||||||
children: React.ReactNode
|
|
||||||
}) {
|
|
||||||
const searchParams = useSearchParams()
|
const searchParams = useSearchParams()
|
||||||
const projectId = searchParams.get('project') || undefined
|
const projectId = searchParams.get('project') || undefined
|
||||||
|
|
||||||
@@ -236,3 +234,19 @@ export default function SDKRootLayout({
|
|||||||
</SDKProvider>
|
</SDKProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// =============================================================================
|
||||||
|
// MAIN LAYOUT (wraps in Suspense for useSearchParams)
|
||||||
|
// =============================================================================
|
||||||
|
|
||||||
|
export default function SDKRootLayout({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<Suspense fallback={<div className="min-h-screen bg-gray-50" />}>
|
||||||
|
<SDKRootWithParams>{children}</SDKRootWithParams>
|
||||||
|
</Suspense>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user