-
Notifications
You must be signed in to change notification settings - Fork 280
Description
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:
- Accept the new two-argument signature
revalidateTag(tag: string, profile: string) - Use the
profileparameter to control revalidation behavior (e.g.'max'for stale-while-revalidate) - 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
revalidateTagAPI now requires a secondprofileargument. Using the old single-argument form causes a TypeScript build error: 'Expected 2 arguments, but got 1'."