[GH-ISSUE #708] Update revalidateTag shim to support new two-argument signature (tag, profile) #149

Open
opened 2026-05-06 12:37:39 +02:00 by BreizhHardware · 0 comments

Originally created by @github-actions[bot] on GitHub (Mar 29, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/708

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: github.com/vercel/next.js@e586cda317

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'."
Originally created by @github-actions[bot] on GitHub (Mar 29, 2026). Original GitHub issue: https://github.com/cloudflare/vinext/issues/708 ## 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:** https://github.com/vercel/next.js/commit/e586cda31772c875bd2f5ed52f3c007357c82522 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'."
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#149
No description provided.