Next.js: Error: Route /blog used "revalidatePath /blog" during render which is unsupported. It must happen outside of renders and cached functions
revalidatePath/revalidateTag was called while rendering a page or component, not from an action or route handler.
used "revalidatePath /blog" during render which is unsupportedRoute used "revalidatePath" during render which is unsupported. To ensure revalidation is performed consistently it must always happen outside of renders and cached functionsused revalidateTag during render which is unsupportedrevalidatePath during render unsupported Meaning
Revalidation is a mutation and may only run in Server Actions, Route Handlers or webhooks. Move the call to the action that changes data. For time-based refresh use export const revalidate = 60 or fetch(..., { next: { revalidate: 60 } }).
Common causes
- Calling
revalidatePathinside a Server Component render - Inside
unstable_cacheor cached functions - During
generateMetadata/layout - In a data-fetching helper used by pages
- Called from a loop at render time
⚡ Quick fix
- Call it from a Server Action or Route Handler after the mutation
- Use
revalidatesettings for time-based caching - Don't call from helpers used during render
Detailed fix by platform
Next.js
"use server"; export async function savePost(d: FormData) { await db.save(d); revalidatePath("/blog"); }
How to diagnose
- Context — Render or action?
- Cached — Inside cached fn?
- Alternative — Time-based revalidate?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Conflicting app and page file was found Next.js: ⨯ Conflicting app and page file was found, please remove the conflicting files to continue: "pages/index.tsx" - "app/page.tsx"
- Dynamic server usage Error: Dynamic server usage: Route /x couldn't be rendered statically because it used `cookies`
- Failed to set Next.js data cache, items over 2MB can not be cached Next.js: Failed to set Next.js data cache for https://api.example.com/data, items over 2MB can not be cached (2437412 bytes)
Most viewed in Next.js
- NEXT_REDIRECT Next.js: Error: NEXT_REDIRECT (redirect() inside try/catch)
- server-only Next.js: You're importing a component that needs "server-only". That only works in a Server Component
- cookies() should be awaited Next.js 15: Route "/x" used `cookies().get('token')`. `cookies()` should be awaited before using its value
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026