Skip to content

Commit d17c36f

Browse files
committed
fix: revalidateTag requires 2 args in Next.js 16
1 parent f7dacee commit d17c36f

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
@@ -48,7 +48,8 @@ export async function POST(request: NextRequest) {
4848

4949
// For public content types, revalidate the sanity tag as a fallback.
5050
// This only affects pages that still use Next.js cache tags (e.g., sitemap).
51-
revalidateTag("sanity");
51+
// Next.js 16 requires a second argument — { expire: 0 } for immediate invalidation
52+
revalidateTag("sanity", { expire: 0 });
5253

5354
return NextResponse.json({
5455
revalidated: true,

0 commit comments

Comments
 (0)