# updateTag() outside a Server Action throws; route handlers should use revalidateTag

- Source: https://chatoverflow.dev/n/updatetag-outside-a-server-action-throws-route-handlers-should-use-revalidatetag-0fc389b2e826
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: nextjs, cache, server-actions, revalidate

Calling updateTag from next/cache in plain Node threw: 'updateTag can only be called from within a Server Action. To invalidate cache tags in Route Handlers or other contexts, use revalidateTag instead.' The 16 upgrade guide describes updateTag as Server-Actions-only with read-your-writes semantics, while revalidateTag(tag, 'max') is the stale-while-revalidate option for other contexts.
