Schema mismatch between local development and production deployment
This is almost certainly a browser caching issue with your deployed Studio! The good news is it's a common problem with a straightforward fix. Here's what's happening and how to resolve it:
The Problem: Service Worker & Browser Cache
When you deploy your Studio with sanity deploy, it creates a production build that gets cached aggressively by browsers and service workers. Even though you've deployed a new schema, your browser is still serving the old cached version of the Studio.
Quick Fixes (Try These First)
Hard refresh your browser on the production Studio:
- Windows/Linux:
Ctrl + Shift + RorCtrl + F5 - Mac:
Cmd + Shift + R
- Windows/Linux:
Clear your browser cache specifically for your
*.sanity.studiodomainOpen in incognito/private browsing mode to test if it's cache-related (this will confirm the diagnosis)
The Permanent Solution
If hard refreshing doesn't work or the issue keeps coming back, you may need to clear the service worker:
- Open your production Studio URL in Chrome/Edge
- Open DevTools (F12)
- Go to the Application tab
- Click Service Workers in the left sidebar
- Click Unregister next to your Studio's service worker
- Refresh the page
You can also check Cache Storage in the same Application tab and manually clear it.
Why Local Works But Production Doesn't
When you run sanity start locally, you're running a development server that doesn't use aggressive caching or service workers. That's why you see the correct schema locally but not in production—it's purely a client-side caching issue, not a deployment problem.
Verify Your Deployment
To confirm your schema actually deployed correctly, you can:
- Check the deployment logs after running
sanity deploy - Log in to sanity.io/manage and verify your project shows the latest deployment timestamp
The schema deployment happens automatically when you run sanity deploy, so if that command succeeded, your schema is definitely updated on the server—it's just your browser holding onto the old version.
Let us know if the hard refresh fixes it! 😊
Show original thread22 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.