errors/revalidate-tag-single-arg.mdx
You are using revalidateTag without providing the second argument, which is now deprecated. The function now requires a second argument to specify the revalidation behavior.
Update your revalidateTag calls to include the second argument "max":
// Before (deprecated)
revalidateTag('posts')
// After
revalidateTag('posts', 'max')
If you're calling this from a Server Action and need immediate expiration for read-your-own-writes, use updateTag instead:
// In a Server Action
import { updateTag } from 'next/cache'
export async function createPost() {
// ... create post ...
// Immediately expire the cache
updateTag('posts')
}
revalidateTag(tag, "max") (recommended): The tag entry is marked as stale, and the next time a resource with that tag is visited, it will use stale-while-revalidate semantics. This means the stale content is served while fresh content is fetched in the background.
revalidateTag(tag, profile): For advanced usage, you can specify any cache life profile that your application has defined in your next.config instead of "max", allowing for custom revalidation behaviors.
updateTag(tag): Only available in Server Actions. The tag entry is expired immediately, and the next request to that resource will be a blocking revalidate/cache miss. This ensures read-your-own-writes consistency.
revalidateTag(tag) without second argument (deprecated): Same behavior as updateTag but shows this deprecation warning.