{"record":{"id":"58b4ce7da7d35994","repo":"vercel/next.js","slug":"warning-invalid-tags-passed-to-description","errorCode":null,"errorMessage":"Warning: invalid tags passed to ${description}: ","messagePattern":"Warning: invalid tags passed to (.+?): ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/lib/patch-fetch.ts","lineNumber":162,"sourceCode":"      })\n    } else {\n      // Encode so a non-ASCII tag can be safely serialized into the\n      // `x-next-cache-tags` HTTP header without tripping Node's header\n      // validation. Length is checked on the raw input above.\n      validTags.push(encodeHeaderSafe(tag))\n    }\n\n    if (validTags.length > NEXT_CACHE_TAG_MAX_ITEMS) {\n      console.warn(\n        `Warning: exceeded max tag count for ${description}, dropped tags:`,\n        tags.slice(i).join(', ')\n      )\n      break\n    }\n  }\n\n  if (invalidTags.length > 0) {\n    console.warn(`Warning: invalid tags passed to ${description}: `)\n\n    for (const { tag, reason } of invalidTags) {\n      console.log(`tag: \"${tag}\" ${reason}`)\n    }\n  }\n  return validTags\n}\n\nfunction trackFetchMetric(\n  workStore: WorkStore,\n  span: Span | undefined,\n  ctx: Omit<FetchMetric, 'end' | 'idx'>\n) {\n  const metric = {\n    ...ctx,\n    end: performance.timeOrigin + performance.now(),\n    idx: workStore.nextFetchId || 0,\n  }","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/lib/patch-fetch.ts#L144-L180","documentation":"validateTags collects tags that are non-strings or exceed NEXT_CACHE_TAG_MAX_LENGTH and warns with this message, then logs each invalid tag with its reason; invalid tags are excluded from revalidation tagging rather than failing the fetch.","triggerScenarios":"Thrown at packages/next/src/server/lib/patch-fetch.ts:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only valid cache tag strings (no invalid characters, within length limits) to fetch/revalidate."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}