Issue with custom decorator not displaying in block content editor after deployment.
I can see what's happening here! The issue isn't with your decorator syntax - your code is actually correct. The problem is that you have existing content in production that contains sup marks, but your production Studio hasn't been updated with the schema that recognizes those marks.
What's Actually Going Wrong
When you developed locally, you:
- Added the
supdecorator to your schema - Created or edited content that used the superscript formatting
- That content was saved with
supmarks in the Content Lake
When you deployed to production:
- Your content (with
supmarks) exists in the Content Lake - But your production Studio doesn't have the updated schema yet
- The Studio tries to load content with
supmarks but says "I don't recognize this decorator"
Your decorator syntax is fine - using component and icon at the root level is correct. The error message "Block with key 'dae3f4812ac2' contains marks (sup) not supported by the current content model" means the Studio schema doesn't match the content.
How to Fix It
Deploy your Studio to production:
sanity deployThis will update your production Studio with the new schema that includes the sup decorator. Once deployed:
- Hard refresh your browser (Ctrl+Shift+R / Cmd+Shift+R) in the production Studio
- The Superscript button should now appear in the toolbar
- The error should disappear because the Studio now recognizes
supmarks
Why It Worked Locally
Your local development environment had the updated schema from the moment you added it, so there was never a mismatch between the content and the schema definition.
Frontend Rendering
Don't forget that when rendering this Portable Text on your frontend, you'll need to handle the sup decorator in your serializer:
const sup = (props) => <sup>{props.children}</sup>
<BlockContent
blocks={yourContent}
serializers={{marks: {sup}}}
/>Or if you're using modern @portabletext/react:
import {PortableText} from '@portabletext/react'
const components = {
marks: {
sup: ({children}) => <sup>{children}</sup>
}
}
<PortableText value={yourContent} components={components} />The key takeaway: your decorator code is correct, you just need to deploy your Studio so production has the updated schema!
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.