Skip to content

Update revalidateTag shim to support new two-argument signature (tag, profile) #708

@github-actions

Description

@github-actions

Next.js Change

revalidateTag now requires a second profile argument. The old single-argument form revalidateTag(tag) is deprecated and causes a TypeScript build error in Next.js 16. The new signature is revalidateTag(tag, profile) where profile controls stale-while-revalidate semantics (e.g. 'max').

Upstream commit: vercel/next.js@e586cda

This commit updates 14 call sites across 6 docs files from revalidateTag(tag) to revalidateTag(tag, 'max'). The actual function signature change happened in an earlier commit but this confirms the API is now stable and documented.

Impact on vinext

The revalidateTag shim in vinext (likely in shims/ or server/) needs to:

  1. Accept the new two-argument signature revalidateTag(tag: string, profile: string)
  2. Use the profile parameter to control revalidation behavior (e.g. 'max' for stale-while-revalidate)
  3. Maintain backward compatibility with the single-argument form if desired, or match Next.js behavior and require both arguments

The ISR cache layer (isr-cache.ts) and CacheHandler may also need updates if the profile parameter affects cache invalidation strategy.

References

  • Next.js commit message states: "The revalidateTag API now requires a second profile argument. Using the old single-argument form causes a TypeScript build error: 'Expected 2 arguments, but got 1'."

Metadata

Metadata

Assignees

No one assigned

    Labels

    nextjs-trackingTracking issue for a Next.js canary change relevant to vinext

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions