How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Sanity Studio stuck on "Loading documents..." indefinitely

10 repliesLast updated: Nov 29, 2025

Hi! In my Sanity Studio (local, not deployed) my documents won’t load. I am using React on the frontend to dynamically create a new User and Pins etc but it’s just stuck on “Loading documents…” for a long time. What can be the issue?
AI Update

When Sanity Studio gets stuck on "Loading documents…" for a long time locally, this is usually a configuration issue. Here are the most common causes and solutions:

Check Your Configuration File

First, make sure your sanity.config.js (or sanity.config.ts) has the correct projectId and dataset configured. Using defineConfig, your config should look something like this:

import { defineConfig } from 'sanity'
import { structureTool } from 'sanity/structure'

export default defineConfig({
  name: 'default',
  title: 'My Studio',
  projectId: 'your-project-id', // Make sure this is correct
  dataset: 'production',         // Make sure this matches your dataset
  plugins: [
    structureTool()
  ],
  schema: {
    types: [/* your schema types */]
  }
})

Environment Variables in Studio v3+

If you're using environment variables, note that Sanity Studio v3+ requires the SANITY_STUDIO_ prefix for environment variables to be accessible in the browser. Your .env file should look like:

SANITY_STUDIO_PROJECT_ID=your-project-id
SANITY_STUDIO_DATASET=production

Then reference them in your config:

export default defineConfig({
  projectId: process.env.SANITY_STUDIO_PROJECT_ID,
  dataset: process.env.SANITY_STUDIO_DATASET,
  // ... rest of config
})

Common Issues & Solutions

Quick Debugging Steps

If you're still stuck after trying these solutions, check the browser console for specific error messages - they'll usually point you to the exact configuration issue.

Show original thread
10 replies

Was this answer helpful?

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.

Related contributions