vercel/next.js · error · Error
Pass `Infinity` instead of `false` if you want to cache on t
Error message
Pass `Infinity` instead of `false` if you want to cache on the client forever without checking with the server.
What it means
Value normalization in normalizeCacheLifeValue: the stale key of a cacheLife profile was set to false. false is not a duration; the supported way to express "never goes stale on the client" is Infinity, so the guard rejects false and names the correct replacement.
Source
Thrown at packages/next/src/server/use-cache/cache-life-profile.ts:30
expire?: number
}
type CacheLifeProfileContext =
| { kind: 'inline' }
| { kind: 'config'; profileName: string }
function normalizeCacheLifeValue(
key: keyof CacheLife,
value: unknown,
context: CacheLifeProfileContext
): number | undefined {
if (value === undefined) {
return undefined
}
if (value === false) {
if (key === 'stale') {
throw new Error(
'Pass `Infinity` instead of `false` if you want to cache on the client forever ' +
'without checking with the server.'
)
} else if (key === 'revalidate') {
throw new Error(
'Pass `Infinity` instead of `false` if you do not want to revalidate by time.'
)
} else {
throw new Error(
'Pass `Infinity` instead of `false` if you want to cache on the server forever ' +
'without checking with the origin.'
)
}
}
if (typeof value !== 'number') {
throw new Error(`The ${key} option must be a number of seconds.`)
}View on GitHub (pinned to 0eb3775416)
Solutions
- Use Infinity instead of false for the cacheLife stale value.
Defensive patterns
Strategy: validation
When it happens
Trigger: A cacheLife stale value of false is configured.
Common situations: Use Infinity instead of false for infinite client-side cache in cacheLife profiles.
AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19).
Data as JSON: /api/errors/a4c13666b14590fe.
Report an issue: GitHub.