Skip to content

Commit 768d8a9

Browse files
committed
fix: revalidateTag requires 2 args in Next.js 16 — add { expire: 0 } for immediate invalidation
1 parent d1e0c58 commit 768d8a9

File tree

1 file changed

+2
-1
lines changed
  • app/api/webhooks/sanity-revalidate

1 file changed

+2
-1
lines changed

app/api/webhooks/sanity-revalidate/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export async function POST(request: NextRequest) {
2525

2626
// Revalidate all sanity-tagged caches (the "heavy hammer" approach)
2727
// This is a backup for when no visitors are active to trigger SanityLive revalidation
28-
revalidateTag("sanity");
28+
// Next.js 16 requires a second argument — { expire: 0 } for immediate invalidation
29+
revalidateTag("sanity", { expire: 0 });
2930

3031
return NextResponse.json({
3132
revalidated: true,

0 commit comments

Comments
 (0)