vercel/next.js · error

Warning: revalidatePath received "${originalPath}" which exc

Error message

Warning: revalidatePath received "${originalPath}" which exceeded max length of ${NEXT_CACHE_SOFT_TAG_MAX_LENGTH}. See more info here https://nextjs.org/docs/app/api-reference/functions/revalidatePath

What it means

Error "Warning: revalidatePath received "${originalPath}" which exceeded max length of ${NEXT_CACHE_SOFT_TAG_MAX_LENGTH}. See more info here https://nextjs.org/docs/app/api-reference/functions/revalidatePath" thrown in vercel/next.js.

Source

Thrown at packages/next/src/server/web/spec-extension/revalidate.ts:108

        'See more info here: https://nextjs.org/docs/app/api-reference/functions/refresh'
    )
  }

  if (workStore) {
    // The Server Action version of refresh() only revalidates the dynamic data
    // on the client. It doesn't affect cached data.
    workStore.pathWasRevalidated = ActionDidRevalidateDynamicOnly
  }
}

/**
 * This function allows you to purge [cached data](https://nextjs.org/docs/app/building-your-application/caching) on-demand for a specific path.
 *
 * Read more: [Next.js Docs: `revalidatePath`](https://nextjs.org/docs/app/api-reference/functions/revalidatePath)
 */
export function revalidatePath(originalPath: string, type?: 'layout' | 'page') {
  if (originalPath.length > NEXT_CACHE_SOFT_TAG_MAX_LENGTH) {
    console.warn(
      `Warning: revalidatePath received "${originalPath}" which exceeded max length of ${NEXT_CACHE_SOFT_TAG_MAX_LENGTH}. See more info here https://nextjs.org/docs/app/api-reference/functions/revalidatePath`
    )
    return
  }

  let normalizedPath = `${NEXT_CACHE_IMPLICIT_TAG_ID}${encodeHeaderSafe(removeTrailingSlash(originalPath))}`

  if (type) {
    normalizedPath += `${normalizedPath.endsWith('/') ? '' : '/'}${type}`
  } else if (isDynamicRoute(originalPath)) {
    console.warn(
      `Warning: a dynamic page path "${originalPath}" was passed to "revalidatePath", but the "type" parameter is missing. This has no effect by default, see more info here https://nextjs.org/docs/app/api-reference/functions/revalidatePath`
    )
  }

  const tags = [normalizedPath]
  if (normalizedPath === `${NEXT_CACHE_IMPLICIT_TAG_ID}/`) {
    tags.push(`${NEXT_CACHE_IMPLICIT_TAG_ID}/index`)

View on GitHub (pinned to 258b1c1bc0)

Solutions

  1. Shorten the path passed to revalidatePath so its derived tag is under the max length.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/next/src/server/web/spec-extension/revalidate.ts:99 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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