Issues with updating documents and schema in Sanity Studio

23 replies
Last updated: Mar 24, 2022
I tried to add a a few new documents to the schema. I also added new types to the existing documents on my schema. The existing documents updated on the localhost:3333 studio but did not update on the sanity.io/manage site. Also, the new documents added did not update on the localhost nor on the sanity.io/manage site. I have imported them in the schema.js file as shown in the image but am not understanding why the new documents are not updating, image below for one new document created, both on the localhost and on the sanity.io/manage site? Any thoughts?
AI Update

Based on your description, I think there's some confusion about where you should see your schema changes. Let me clarify:

Important: The sanity.io/manage site is your project management dashboard - it's not your actual Studio where you edit content. You won't see your schema changes there. That's just for managing projects, datasets, team members, and billing.

Your actual content Studio is:

  • Running locally at localhost:3333 (dev environment)
  • OR deployed to a URL like yourproject.sanity.studio (production)

Why your new document types aren't showing up:

Since you mentioned you've imported them in schema.js, here are the most common issues:

1. Check your sanity.config.js file

Your schema needs to be registered in your sanity.config.js (or .ts) file, not just imported in a schema file. It should look something like this:

import { defineConfig } from 'sanity'
import { structureTool } from 'sanity/structure'
import { schemaTypes } from './schemas'

export default defineConfig({
  name: 'default',
  title: 'My Project',
  projectId: 'your-project-id',
  dataset: 'production',
  
  plugins: [structureTool()],
  
  schema: {
    types: schemaTypes, // Your schemas need to be here
  },
})

2. Restart your dev server

After adding new document types, you must restart your local Studio:

  • Stop your dev server (Ctrl+C)
  • Run sanity dev (or npm run dev) again

Schema changes don't always hot-reload properly.

3. Check for errors

Look at your terminal/console where you're running the Studio. Any schema validation errors will show up there and prevent types from loading. Common issues:

  • Syntax errors in your schema files
  • Missing required fields (like name or type)
  • Circular dependencies between schema types

4. Verify your schema exports

If you have a separate schema file, make sure you're properly exporting all types:

// schemas/index.js
import myNewDocument from './myNewDocument'
import anotherNewDocument from './anotherNewDocument'

export const schemaTypes = [
  myNewDocument,
  anotherNewDocument,
  // ... other existing types
]

About deployed Studios:

If you have a deployed Studio (using sanity deploy), you need to rebuild and redeploy to see schema changes there:

sanity deploy

The auto-updates feature only handles Sanity framework version updates - it doesn't automatically sync your custom schema changes.

Quick checklist:

  1. ✅ Schema types are exported from your schema file
  2. ✅ Schema types are registered in sanity.config.js under schema.types
  3. ✅ Dev server has been restarted
  4. ✅ No errors in the terminal/console
  5. ✅ Run sanity deploy to update your production Studio

If you're still stuck after checking these, share any error messages from your console - that'll help pinpoint the exact issue!

When you say sanity.io/mange , do you mean your deployed Studio?
Yes, deployed studio
Got it. You have to redeploy your studio in order for changes made to the Studio itself to be reflected. Your content will be updated in real time, though.
That;s cool. I did run a yarn build again, is that how you redeploy?
That could be the reason I do not see the preview on the deployed studio also.
sanity deploy
should do it.
great thank you for the help
You're welcome!
Well that definitely fixed my preview issue but it is has not fixed the issue with a new document. I tried with a simple document, image below but it is not working (creating the document in studio) on localhost .
A console.log in schema.js shows that is correctly importing into schema.js
Also, changing the 'name' property on one of the documents already loaded throws an error stating the " Schema type with 'old name' not found. Shouldn't this update? I think it is cache problem. Is there anyway to clear the cache in sanity?
in sanity?
You're likely using the old name somewhere in your schema.
No this was reduced to the simplest schema to test. I still cannot add any new documents.
So if i go to the create new document in the studio the documents appear but never show up on the ist?
If I'm understanding correctly, are you hoping to have a document (meaning, one that you added content to or published) show up in that first image?
If so, that list is only a shortcut to create a new document. Your content shows up in the desk below.

But let me know if that's not what you're looking for.
The documents are not being added to the list. I located them in the create new document window, but nothing is added to the list you are referring to
The content list on the desk
I even copied the movies schema from the docs and the same result. It doe s not show under the content list but it shows in the create a new documnt window so I know it is loading
My guess would be it has something to do with the preview and the resolveProductionUrl function. I tried to add it to my switch case to see if that was it but no luck, it is commented out as an example
The production url would only affect your preview, so it won't interfere with your desk. A few things to check: is the document added to schema.js? Do you have a custom desk structure that maybe doesn't include these types?
You can also share your repo and I can look over it if you like.
Thank you, I will give it a shot and let you know

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?