I have the following project to reproduce the problem: GitHub - GeorgeHulpoi/nextjs-vercel-data-cache-bug.
Next.js issue: Inconsistency between Local and Vercel related to Cache Data · Issue #73683 · vercel/next.js · GitHub
The project is very simple:
- The home page fetch an API that response a v4 code.
- There is
/api/revalidate-tag
that is callingrevalidateTag
forv4
tag used by fetch in home page.
Based on the following line from docummentation Data Cache and Full Route Cache
- Revalidating or opting out of the Data Cache will invalidate the Full Route Cache, as the render output depends on data.
Therefore, this behavior is working fine on local. Nonetheless, on Vercel sometimes work, sometimes is stuck.
Trying multiple times the expected behavior will end up “blocking” the revalidate. More exactly, the revalidate doesn’t have any effect anymore.
BUT, I found an interesting behavior. Trying once won’t revalidate. Trying multiple times at once (like pressing CTRL + F5 multiple times very fast) seems to “unstuck” the cache.
Also, the “spam revalidate” seems to produce a warning in Logs:
Failed to revalidate tag [ 'v4' ] Error [AbortError]: This operation was aborted
at async A.revalidateTag (/opt/rust/next-data.js:2:6099) {
code: 20,
INDEX_SIZE_ERR: 1,
DOMSTRING_SIZE_ERR: 2,
HIERARCHY_REQUEST_ERR: 3,
WRONG_DOCUMENT_ERR: 4,
INVALID_CHARACTER_ERR: 5,
NO_DATA_ALLOWED_ERR: 6,
NO_MODIFICATION_ALLOWED_ERR: 7,
NOT_FOUND_ERR: 8,
NOT_SUPPORTED_ERR: 9,
INUSE_ATTRIBUTE_ERR: 10,
INVALID_STATE_ERR: 11,
SYNTAX_ERR: 12,
INVALID_MODIFICATION_ERR: 13,
NAMESPACE_ERR: 14,
INVALID_ACCESS_ERR: 15,
VALIDATION_ERR: 16,
TYPE_MISMATCH_ERR: 17,
SECURITY_ERR: 18,
NETWORK_ERR: 19,
ABORT_ERR: 20,
URL_MISMATCH_ERR: 21,
QUOTA_EXCEEDED_ERR: 22,
TIMEOUT_ERR: 23,
INVALID_NODE_TYPE_ERR: 24,
DATA_CLONE_ERR: 25
}
Can someone investigate further?