next.js
8d4f4fcd - revalidate APIs should make route handlers dynamic (#58466)

Commit
2 years ago
revalidate APIs should make route handlers dynamic (#58466) ### What? Using `revalidateTag` or `revalidatePath` in a route handler will not currently opt the handler into dynamic behavior. This means that if you use these APIs and don't opt into dynamic behavior by some other means, the revalidation call won't do anything as the route handler will be served statically. ### Why? During static generation, we do not currently indicate that usage of these APIs should opt into dynamic usage. ### How? This updates `revalidateTag` to throw a `DynamicUsageError` (similar to our other scenarios, such as search params bailout, headers/cookies, or fetch + revalidate/no-store) Closes NEXT-1712
Author
Parents
Loading