Files
Jude GaoandGitHub 6797a087e5 Fix: Do not force BLOCKING_STATIC_RENDER for DOM bots (#82427)
The issue was that DOM bots with PPR-enabled routes were being forced to
use BLOCKING_STATIC_RENDER mode, which prevented them from using the
fallback cache lookup mechanism. This caused them to generate new
content with isRevalidating: true, which blocks postponed data and
triggers the Math.random() static generation bailout error.

For HTML bots, they keep using BLOCKING_STATIC_RENDER because SSG was
turned off for them and won't see the SSG bailout error. For DOM bots,
they should behave like a normal user.

Fixes NAR-273
2025-08-08 13:03:27 -04:00

30 lines
669 B
TypeScript

import React from 'react'
import type { Metadata } from 'next'
export async function generateMetadata(): Promise<Metadata> {
await new Promise((resolve) => setTimeout(resolve, 1000)) // Simulate a delay
return {
title: 'Home',
description: 'Welcome to the home page',
}
}
export default async function Home({
params,
}: {
params: Promise<{ slug: string }>
}) {
const { slug } = await params
// Math.random() will cause SSG_BAILOUT if static generation runs
// Bots should bypass static generation in PPR to avoid this error
const randomValue = Math.random()
return (
<>
<h1>{slug}</h1>
<p>{randomValue}</p>
</>
)
}