Max listener limit exceeded at 1004 error in Sanity Studio
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:
- Multiple Studio instances - Every browser tab/window with Studio open creates listeners
- Document subscriptions - Each open document view subscribes to changes
- Structure Builder views - Complex desk structures with many list items can create multiple listeners
- Leaked connections - Sometimes connections don't close properly when navigating away
- Development environment - Hot reloading during development can create orphaned listeners
How to fix this:
Immediate steps:
- Close unnecessary Studio tabs/windows - Each instance creates listeners
- Clear your browser cache and restart - This can help clean up stale connections
- Wait 30 minutes - Listener connections have a maximum lifetime of 30 minutes and will eventually expire
- Check for other team members - If multiple people have Studio open, you're sharing the listener pool
Longer-term solutions:
- Upgrade your plan - A Growth plan gives you 5,000 concurrent listeners
- Review your Structure Builder - Simplify complex structures that might be creating excessive listeners
- Check for custom plugins - Any custom code using
client.listen()could be creating extra connections - Monitor the API request logs in your project dashboard to see listener activity
For development:
- Use
sanity devinstead 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 thread7 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.