
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see you're experiencing a network-level error (UND_ERR_SOCKET with "other side closed") when trying to fetch from Sanity's GraphQL API. This type of error indicates the connection is being terminated unexpectedly, which can have several causes.
Understanding the error:
The TypeError: terminated with the underlying SocketError: other side closed from undici (Node's HTTP client) means your request started but the connection was closed before completing. This is a network/connection issue rather than a GraphQL query problem.
Possible causes:
Immediate troubleshooting steps:
Check Sanity's status: Visit sanity-status.com to see if there are any ongoing incidents. If there's an active incident, you'll need to wait for Sanity's team to resolve it.
Verify your endpoint: Ensure you're using the correct GraphQL API endpoint format. The GraphQL API should be deployed using sanity graphql deploy and accessed at your project's apicdn domain.
Test with GROQ as a workaround: While troubleshooting, you can use GROQ queries via the HTTP API as an alternative to verify if the issue is specific to GraphQL or affects all API access.
Network diagnostics:
Code-level fixes:
Check for rate limiting: If you're fetching the GraphQL schema on every build or hot reload, you might be hitting rate limits. Consider caching the schema or reducing fetch frequency during development.
If the issue persists:
Since this started 2 days ago and involves connection termination, it could be infrastructure-related. I'd recommend:
The error you're seeing is at the network/transport layer rather than the GraphQL application layer, which suggests either infrastructure issues or network connectivity problems between your application and Sanity's API servers. The status page will show if there's a known incident, but if everything appears operational there and you're still experiencing issues, support can investigate your specific project.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store