Skip to content

Commit f9dd040

Browse files
committed
fix(web): await replay [id] params inside Suspense for Next 16 cacheComponents
Public /replay/[id] (outside the (app)/Clerk group) was statically prerendered at build and failed cacheComponents' 'uncached data outside <Suspense>' check on `await params`. Wrap the param-awaiting child in <Suspense> (same pattern as the home-page searchParams fix). Verified with a full local web build.
1 parent 122a4af commit f9dd040

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

apps/web/src/app/replay/[id]/page.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Metadata } from "next";
2+
import { Suspense } from "react";
23
import { ReplayView } from "@/components/replay/replay-view";
34

45
/**
@@ -13,7 +14,19 @@ export const metadata: Metadata = {
1314
title: "Replay · Cheatcode",
1415
};
1516

16-
export default async function ReplayPage({ params }: { params: Promise<{ id: string }> }) {
17+
// `cacheComponents` (Next 16) requires uncached request data — here `await params`
18+
// on this public route outside the (app)/Clerk group — to resolve inside a
19+
// <Suspense> boundary, else static prerender fails with "uncached data accessed
20+
// outside <Suspense>". Matches the home-page searchParams-in-Suspense pattern.
21+
export default function ReplayPage({ params }: { params: Promise<{ id: string }> }) {
22+
return (
23+
<Suspense fallback={null}>
24+
<ReplayContent params={params} />
25+
</Suspense>
26+
);
27+
}
28+
29+
async function ReplayContent({ params }: { params: Promise<{ id: string }> }) {
1730
const { id } = await params;
1831
return <ReplayView id={id} />;
1932
}

0 commit comments

Comments
 (0)