Sanity Studio: "Field not defined in schema" error for external link after deployment
Based on your schema code, the issue is almost certainly that you haven't deployed your Studio changes to your hosted environment. When you see "This field is not defined in the schema" in your live Studio but it works locally, it means your local schema differs from what's deployed.
The sanity deploy command you ran deploys your Studio application (the interface itself), but it doesn't necessarily update the schema that other Sanity services see. However, for basic Studio functionality, deploying the Studio should be sufficient.
Here are the most likely causes and solutions:
1. Cache Issues After deploying, try these steps:
- Hard refresh your browser (Ctrl+Shift+R or Cmd+Shift+R)
- Clear your browser cache completely
- Try accessing the Studio in an incognito/private window
2. Verify Your Deployment Make sure your deployment actually included the schema changes:
- Check that your
blockContent.jsfile is properly imported in your schema - Verify the file is in your repository and committed
- Redeploy with
sanity deployto be certain
3. Check for Multiple Schema Definitions
If you have the link annotation defined in multiple places in your schema, make sure they're all consistent. The deployed version might be picking up an older definition.
4. Schema Deployment (if using Canvas, Dashboard, or Agent Actions) If you're using newer Sanity features like Canvas or Agent Actions, you may also need to run:
sanity schema deployThis is different from sanity deploy and makes your schema available to other Sanity apps beyond Studio. However, this typically isn't required for basic Studio functionality.
5. Verify Your Schema Syntax
Your schema looks correct, but double-check that it's properly exported and imported into your main schema configuration file (usually schema.js or within your sanity.config.js).
The most common fix is simply a hard refresh after deployment, as browsers aggressively cache Studio assets. If that doesn't work, try redeploying and accessing from a private browsing window to rule out caching entirely.
Show original thread9 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.