vercel/next.js · error · Error

Unknown \`cacheLife()\` profile "${profile}" is not configur

Error message

Unknown \`cacheLife()\` profile "${profile}" is not configured in next.config.js\nDid you mean "${profile.trim()}" without the spaces?

What it means

Validation in cacheLife(): the string profile name is not a key in workStore.cacheLifeProfiles (the profiles configured in next.config.js plus built-ins), but the trimmed version profile.trim() IS configured. This detects a whitespace typo in the profile name and suggests the trimmed variant before falling through to the general unknown-profile error.

Source

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

    case 'private-cache':
      break
    default:
      workUnitStore satisfies never
  }

  if (typeof profile === 'string') {
    const workStore = workAsyncStorage.getStore()
    if (!workStore) {
      throw new Error(
        '`cacheLife()` can only be called during App Router rendering at the moment.'
      )
    }

    // TODO: This should be globally available and not require an AsyncLocalStorage.
    const configuredProfile = workStore.cacheLifeProfiles[profile]
    if (configuredProfile === undefined) {
      if (workStore.cacheLifeProfiles[profile.trim()]) {
        throw new Error(
          `Unknown \`cacheLife()\` profile "${profile}" is not configured in next.config.js\n` +
            `Did you mean "${profile.trim()}" without the spaces?`
        )
      }
      throw new Error(
        `Unknown \`cacheLife()\` profile "${profile}" is not configured in next.config.js\n` +
          'module.exports = {\n' +
          '  cacheLife: {\n' +
          `    "${profile}": ...\n` +
          '  }\n' +
          '}'
      )
    }
    profile = configuredProfile
  } else if (
    typeof profile !== 'object' ||
    profile === null ||
    Array.isArray(profile)

View on GitHub (pinned to 258b1c1bc0)

Solutions

  1. Remove the extra spaces from the profile name, or define the profile under cacheLife in next.config.js.
Defensive patterns

Strategy: validation

When it happens

Trigger: cacheLife() receives an unknown profile with stray whitespace.

Common situations: A cacheLife profile name with leading/trailing spaces that is not configured in next.config.


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