mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
> [!TIP] > Best reviewed with hide whitespace. ### Why? Cache Components prerenders can fail when an OpenTelemetry tracer is acquired before provider registration and later resolves through proxy tracer delegation: ``` Next.js encountered the unstable value `Math.random()` while prerendering ``` Current behavior: https://github.com/vercel/next.js/actions/runs/28518518762/job/84536475151?pr=95317#step:32:343 ### How? Patch proxy tracer delegation to apply the same Cache Components span instrumentation used for normal tracer lookup. Closes https://github.com/vercel/next.js/issues/94753 <!-- NEXT_JS_LLM_PR -->
19 lines
371 B
TypeScript
19 lines
371 B
TypeScript
import { TracedComponentEarlyTracerSpan } from '../../traced-work'
|
|
|
|
export function generateStaticParams() {
|
|
return [{ slug: 'prerendered' }]
|
|
}
|
|
|
|
export default async function Page({
|
|
params,
|
|
}: {
|
|
params: Promise<{ slug: string }>
|
|
}) {
|
|
const { slug } = await params
|
|
if (slug === 'prerendered') {
|
|
return null
|
|
}
|
|
|
|
return <TracedComponentEarlyTracerSpan />
|
|
}
|