vercel/next.js · error

Warning: exceeded max tag count for ${description}, dropped

Error message

Warning: exceeded max tag count for ${description}, dropped tags:

What it means

validateTags (used by patched fetch for cache tags) warns when more than NEXT_CACHE_TAG_MAX_ITEMS tags are passed for a fetch: tags beyond the cap are dropped (and listed in the warning) so the x-next-cache-tags header stays bounded; the fetch itself proceeds.

Source

Thrown at packages/next/src/server/lib/patch-fetch.ts:153

  for (let i = 0; i < tags.length; i++) {
    const tag = tags[i]

    if (typeof tag !== 'string') {
      invalidTags.push({ tag, reason: 'invalid type, must be a string' })
    } else if (tag.length > NEXT_CACHE_TAG_MAX_LENGTH) {
      invalidTags.push({
        tag,
        reason: `exceeded max length of ${NEXT_CACHE_TAG_MAX_LENGTH}`,
      })
    } else {
      // Encode so a non-ASCII tag can be safely serialized into the
      // `x-next-cache-tags` HTTP header without tripping Node's header
      // validation. Length is checked on the raw input above.
      validTags.push(encodeHeaderSafe(tag))
    }

    if (validTags.length > NEXT_CACHE_TAG_MAX_ITEMS) {
      console.warn(
        `Warning: exceeded max tag count for ${description}, dropped tags:`,
        tags.slice(i).join(', ')
      )
      break
    }
  }

  if (invalidTags.length > 0) {
    console.warn(`Warning: invalid tags passed to ${description}: `)

    for (const { tag, reason } of invalidTags) {
      console.log(`tag: "${tag}" ${reason}`)
    }
  }
  return validTags
}

function trackFetchMetric(

View on GitHub (pinned to 0eb3775416)

Solutions

  1. Reduce the number of cache tags per fetch to under the maximum allowed.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/next/src/server/lib/patch-fetch.ts:153 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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