Issue with updating the Post schema in Sanity Studio.
This is a frustrating but common issue! The good news is it's usually something simple. When your Sanity Studio isn't reflecting schema changes, here are the most common causes and solutions:
1. Hard Refresh Your Browser
The most common culprit is browser caching. Even though the dev server has Hot Module Replacement (HMR), sometimes your browser holds onto the old schema. Try:
- Hard refresh:
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac) - Clear cache: Open DevTools → Network tab → check "Disable cache" and refresh
2. Restart the Dev Server
Sometimes HMR doesn't catch schema changes properly. Stop your dev server (Ctrl+C) and restart it:
npm run dev
# or
sanity start3. Check Your File Location
Make sure you're editing the correct schema file. In a typical Next.js + Sanity setup, there can be confusion about where schemas live:
- Standalone Studio: Schemas are usually in
/schemas/or/schemaTypes/ - Embedded Studio (Studio v3 in Next.js): Schemas might be in
/sanity/schemas/or/app/schemas/
Double-check that the schema file you're editing is actually being imported in your Sanity configuration file.
4. Verify Schema is Imported
Open your sanity.config.ts (or sanity.config.js) and make sure your post schema is properly imported and included in the types array. This is the central configuration file where all schemas must be registered:
import {defineConfig} from 'sanity'
import {post} from './schemas/post'
import {author} from './schemas/author'
export default defineConfig({
// ... other config
schema: {
types: [post, author], // Make sure your schema is here!
},
})5. Check for TypeScript/JavaScript Errors
Look at your terminal where the dev server is running. If there's a syntax error in your schema file, it won't compile and the changes won't show up. The terminal will usually show compilation errors in red.
6. Port Conflicts
Since you mentioned localhost:3333, make sure nothing else is using that port. If another process is occupying it, your Studio might not be running the latest code. You can check by completely stopping the server and restarting it.
Quick Test
Try making a very obvious change to test if HMR is working at all:
{
name: 'title',
title: 'TESTING 123', // Make it obvious
type: 'string'
}If this doesn't show up after a hard refresh, it confirms the schema isn't being picked up.
Still Not Working?
If none of the above works, try this nuclear option:
- Stop the dev server
- Delete
node_modulesand any.sanitycache folders - Run
npm installagain - Restart the dev server
This usually resolves any stubborn caching or module resolution issues that can happen during development.
Let us know which solution worked for you, or if you're still stuck, share your sanity.config.ts file structure and we can help debug further!
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.