Max listener limit exceeded at 1004 error in Sanity Studio

7 replies
Last updated: Jan 28, 2026
Hi Sanity fam, I've been working on a project for a client and just started receiving some Javascript errors stating:
Error: Max listener limit exceeded at 1004
. This started intermittently yesterday and said
at 1001
. It has since stopped being intermittent and is now permanently stating
Error: Max listener limit exceeded at 1004
. I previously figured it was due to some complex deskStructure stuff going on but have now completely removed all the complexities and am attempting to load an
S.editor()
for a specific ID and it's not loading a thing. Restarted the local instance of Studio, cleared by cookies and cache.
Thoughts?
AI Update

Hey there! This is a tricky one, but the "Max listener limit exceeded at 1004" error you're seeing is actually hitting a platform-level limit on concurrent listeners to Sanity's real-time APIs.

Based on the technical limits documentation, Sanity enforces maximum concurrent listener limits per project plan:

  • Free plan: 1,000 listeners
  • Growth plan: 5,000 listeners
  • Enterprise plan: 10,000 listeners

You're hitting the 1,004 listener mark, which suggests you're on a Free plan and have exceeded the 1,000 concurrent listener threshold.

What's causing this?

Each time Studio opens a document or subscribes to real-time updates, it creates listener connections. These can accumulate from:

  1. Multiple Studio instances - Every browser tab/window with Studio open creates listeners
  2. Document subscriptions - Each open document view subscribes to changes
  3. Structure Builder views - Complex desk structures with many list items can create multiple listeners
  4. Leaked connections - Sometimes connections don't close properly when navigating away
  5. Development environment - Hot reloading during development can create orphaned listeners

How to fix this:

Immediate steps:

  1. Close unnecessary Studio tabs/windows - Each instance creates listeners
  2. Clear your browser cache and restart - This can help clean up stale connections
  3. Wait 30 minutes - Listener connections have a maximum lifetime of 30 minutes and will eventually expire
  4. Check for other team members - If multiple people have Studio open, you're sharing the listener pool

Longer-term solutions:

  1. Upgrade your plan - A Growth plan gives you 5,000 concurrent listeners
  2. Review your Structure Builder - Simplify complex structures that might be creating excessive listeners
  3. Check for custom plugins - Any custom code using client.listen() could be creating extra connections
  4. Monitor the API request logs in your project dashboard to see listener activity

For development:

  • Use sanity dev instead of multiple Studio instances
  • Be mindful of hot-reloading creating duplicate connections
  • Consider using a separate development dataset if you're frequently hitting limits

The fact that you're seeing it "permanently" at 1,004 suggests you have active connections that aren't closing. The 30-minute connection lifetime should eventually help, but closing Studio tabs is your quickest fix.

If you continue having issues after trying these steps, you might want to reach out to Sanity support to check if there's something unusual with your project's listener connections.

Show original thread
7 replies

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?