Skip to content

Commit 2d5d63d

Browse files
committed
Use <script> tag instead of Next.js Script component
1 parent 76932f4 commit 2d5d63d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

catalog/app/layout.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { Metadata } from "next";
2-
import Script from "next/script";
32
import "./globals.css";
43

54
const basePath = process.env.NEXT_PUBLIC_BASE_PATH === 'true' ? '/implementation-catalog' : '';
@@ -26,12 +25,12 @@ export default function RootLayout({
2625
}>) {
2726
return (
2827
<html lang="en">
29-
<head />
28+
<head>
29+
{/* Pagefind UI script - must be loaded for search to work */}
30+
<script src={`${basePath}/_pagefind/pagefind-ui.js`} defer />
31+
</head>
3032
<body className="antialiased">
3133
{children}
32-
{/* Pagefind UI - loads after static build */}
33-
{/* Next.js automatically adds basePath from config, so just use relative path */}
34-
<Script src="/_pagefind/pagefind-ui.js" strategy="afterInteractive" />
3534
</body>
3635
</html>
3736
);

0 commit comments

Comments
 (0)