vercel/next.js · error

Warning: a dynamic page path "${originalPath}" was passed to

Error message

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

What it means

Error "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" thrown in vercel/next.js.

Source

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

/**
 * 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`)
  } else if (normalizedPath === `${NEXT_CACHE_IMPLICIT_TAG_ID}/index`) {
    tags.push(`${NEXT_CACHE_IMPLICIT_TAG_ID}/`)
  }

  return revalidate(tags, `revalidatePath(${JSON.stringify(originalPath)})`)
}

function revalidate(
  tags: string[],
  expression: string,
  profile?: string | CacheLifeConfig

View on GitHub (pinned to 258b1c1bc0)

Solutions

  1. Pass the `type` parameter: `revalidatePath(path, "page")` or `revalidatePath(path, "layout")` for dynamic paths.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/next/src/server/web/spec-extension/revalidate.ts:110 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/b4ba5c4ca9c32f3c. Report an issue: GitHub.