Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Next loader] Warning: exceeded max tag count for fetch #2314

Open
PikiLee opened this issue Dec 13, 2024 · 1 comment
Open

[Next loader] Warning: exceeded max tag count for fetch #2314

PikiLee opened this issue Dec 13, 2024 · 1 comment

Comments

@PikiLee
Copy link

PikiLee commented Dec 13, 2024

Describe the bug

Hey there! I’m currently working on a project that retrieves dozens of documents in one query. I noticed some warnings popping up when running the query. Here’s what they say:

Warning: exceeded max tag count for fetch https://***.apicdn.sanity.io/v2024-04-12/data/query/production?query=***&cacheMode=noStale&perspective=published&tag=next-loader.fetch&lastLiveEventId=***, dropped tags: sanity:s1:B/8zWA, sanity:s1:UXvMtQ, sanity:s1:GIWh6w, sanity:s1:MxZjmA, sanity:s1:yg26wQ, sanity:s1:CfDYtw, sanity:s1:Gey+0A, sanity:s1:SfVT0w, sanity:s1:rz7uCg, sanity:s1:2pKhOQ, sanity:s1:wHfThw, sanity:s1:+crJwg, sanity:s1:8rxAwA, sanity:s1:mVUWBg, sanity:s1:QO3maw, sanity:s1:LW3Vgw, sanity:s1:WCLWqw, sanity:s1:j1cU1g, sanity:s1:UZClWQ, sanity:s1:HPO5TQ, sanity:s1:75aatQ, sanity:s1:UyvdtA, sanity:s1:tUE/kg, sanity:s1:JRuWPw, sanity:s1:Djhj/A, sanity:s1:spoinQ

I’ve replaced some characters with *** just to be cautious about any sensitive information and the query was a bit long.

There’s also a performance issue in draft mode whenever this query runs. It can take over ten seconds to load the page in draft mode, and sometimes it even causes an edge function crash error on Netlify where the project hosted.

However, after splitting the query into multiple ones, the warnings disappeared and the performance improved.

I suspect that the issue might be related to the revalidation tags used by next loader during a query, which seem to exceed the maximum allowed tags by Next.js when there are a lot of documents involved.

Which versions of Sanity are you using?

@sanity/cli (global) 3.63.0 (latest: 3.67.1)
@sanity/image-url 1.0.2 (latest: 1.1.0)
@sanity/language-filter 4.0.2 (up to date)
@sanity/orderable-document-list 1.2.2 (up to date)
@sanity/preview-url-secret 1.6.7 (latest: 2.0.5)
@sanity/types 3.62.2 (latest: 3.67.1)
@sanity/ui 2.8.10 (latest: 2.10.9)
@sanity/vision 3.37.2 (latest: 3.67.1)
@sanity/webhook 4.0.3 (latest: 4.0.4)
sanity 3.63.0 (latest: 3.67.1)

next-sanity 9.8.21
next 14.2.8

What operating system are you using?

mac os 14.5

Which versions of Node.js / npm are you running?

v20.18.0

@stipsan
Copy link
Member

stipsan commented Dec 18, 2024

We reached out to Vercel about this, and they increased the limit in next 15.1 to 128. Can you upgrade to that and give it a go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants