Files
JJ KasperandGitHub 49e82cb3a3 Fix missing revalidate with notFound() (#75009)
This is follow-up to https://github.com/vercel/next.js/pull/74607
ensuring we also don't lose the revalidate value configured when
`notFound()` or similar is used.

x-ref: [slack
thread](https://vercel.slack.com/archives/C02K2HCH5V4/p1736954974909349)
2025-01-17 10:52:57 +01:00

24 lines
450 B
TypeScript

import React from 'react'
import { notFound } from 'next/navigation'
export const revalidate = 3
export default async function Page() {
await fetch('https://next-data-api.vercel.app/api/random', {
next: {
tags: ['explicit-tag'],
},
})
if (process.env.NEXT_PHASE === 'phase-production-build') {
notFound()
}
return (
<>
<p>/prerendered-not-found/segment-revalidate</p>
<p>{Date.now()}</p>
</>
)
}