vercel/next.js · error · Error

Pass `Infinity` instead of `false` if you do not want to rev

Error message

Pass `Infinity` instead of `false` if you do not want to revalidate by time.

What it means

Value normalization in normalizeCacheLifeValue: the revalidate key of a cacheLife profile (inline or from config) was set to false. Time-based revalidation durations cannot be false; use Infinity to disable time-based revalidation, which the error message states directly.

Source

Thrown at packages/next/src/server/use-cache/cache-life-profile.ts:35

  | { 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.`)
  }

  if (value === Infinity) {
    // Infinity means "never", but turns into null when serialized as JSON
    // (e.g. for build workers or cache handlers), unlike INFINITE_CACHE.
    return INFINITE_CACHE

View on GitHub (pinned to 0eb3775416)

Solutions

  1. Use Infinity instead of false for the cacheLife revalidate value.
Defensive patterns

Strategy: validation

When it happens

Trigger: A cacheLife revalidate value of false is configured.

Common situations: Use Infinity instead of false to disable time-based revalidation in cacheLife.


AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19). Data as JSON: /api/errors/0afdf499e1b66a14. Report an issue: GitHub.