Skip to content

Commit 905c9bc

Browse files
authored
fix useSearchParams hook static build error (#55)
1 parent c7a762f commit 905c9bc

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

website/app/layout.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Metadata } from 'next';
22
import { ThemeProvider } from 'next-themes';
3-
import { PropsWithChildren } from 'react';
3+
import { PropsWithChildren, Suspense } from 'react';
44

55
import Footer from '~/components/Footer';
66
import Header from '~/components/Header';
@@ -42,13 +42,15 @@ export default function RootLayout({ children }: PropsWithChildren) {
4242
<html lang="en" suppressHydrationWarning>
4343
<body className="relative min-h-dvh antialiased font-sans text-primary bg-background">
4444
<ThemeProvider attribute="data-theme">
45-
<SearchProvider>
46-
<Header />
47-
<div className="min-h-[calc(100dvh-58px)] grid grid-rows-[1fr_min-content]">
48-
{children}
49-
<Footer />
50-
</div>
51-
</SearchProvider>
45+
<Suspense>
46+
<SearchProvider>
47+
<Header />
48+
<div className="min-h-[calc(100dvh-58px)] grid grid-rows-[1fr_min-content]">
49+
{children}
50+
<Footer />
51+
</div>
52+
</SearchProvider>
53+
</Suspense>
5254
</ThemeProvider>
5355
</body>
5456
</html>

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"dev": "next dev",
1010
"build": "next build",
11-
"start": "next start",
11+
"start": "npx serve out",
1212
"lint": "eslint",
1313
"data:fetch": "node ./scripts/fetch-data.mjs"
1414
},

0 commit comments

Comments
 (0)