Portable text editor toolbar suddenly empty/missing

20 replies
Last updated: Apr 23, 2024
Has anyone experienced an issue where the portable text editor shows nothing? We've made no changes to our site but all of a sudden nothing is in the text editor bar.
AI Update

I understand how frustrating this must be! When the Portable Text editor toolbar suddenly appears empty or shows nothing, there are several potential causes to investigate.

Most Common Causes

CSS Conflicts from Global Styles

The most frequent culprit is CSS from your site bleeding into Sanity Studio, particularly if you're using CSS frameworks like Tailwind CSS or other global resets. These frameworks often apply aggressive resets (like removing borders or setting default sizes) that can make Studio UI elements invisible or non-functional. The toolbar buttons might technically still be there in the DOM, but styling conflicts prevent them from displaying.

If you're using Tailwind with Sanity Studio embedded in your site, ensure your Tailwind configuration excludes the Studio path:

// tailwind.config.js
module.exports = {
  content: [
    './app/**/*.{js,ts,jsx,tsx}',
    '!./app/studio/**/*', // Exclude Studio directory
  ],
}

Or consider disabling Tailwind's preflight for Studio pages specifically.

Browser Extensions

Ad blockers, privacy extensions, or browser customization tools can inject CSS or block resources that interfere with Studio's UI. Test in an incognito/private window with extensions disabled to rule this out.

Cached Assets

Sometimes browser caching issues can cause Studio UI components to break, especially after updates. Try:

  • Hard refresh (Ctrl+Shift+R or Cmd+Shift+R)
  • Clear browser cache completely
  • Try a different browser

Schema Configuration Issues

Check your Portable Text editor configuration in your schema. If the toolbar configuration was inadvertently changed or if there's an error in the schema definition, the toolbar might not render properly:

defineField({
  name: 'body',
  type: 'array',
  of: [{
    type: 'block',
    // Ensure marks and styles are properly configured
    marks: {
      decorators: [
        {title: 'Strong', value: 'strong'},
        {title: 'Emphasis', value: 'em'}
      ]
    }
  }]
})

Studio Version or Plugin Conflicts

If you recently updated any dependencies or Studio plugins, there could be compatibility issues. Check your package.json for recent changes and consider:

  • Updating to the latest sanity package version
  • Checking if any custom plugins need updates
  • Reviewing the Studio console for JavaScript errors

Debugging Steps

  1. Check browser console - Look for JavaScript errors or warnings that might indicate what's breaking
  2. Test in isolation - If possible, test the Studio in a standalone environment (not embedded in your site)
  3. Inspect the DOM - Use browser dev tools to see if the toolbar buttons exist but are just hidden by CSS
  4. Review recent changes - Even if you haven't changed your site code, check if dependencies were auto-updated or if browser/OS updates occurred

Since you mentioned making no changes, the issue likely stems from something external to your codebase - a browser update, extension installation, or possibly a dependency that auto-updated. The CSS conflict scenario is particularly common when Sanity Studio is embedded within a Next.js or other framework application where global styles can inadvertently affect Studio components.

Show original thread
20 replies
Is your Studio embedded in a Next app?
user D
Wondering about RD’s question.
It is embedded, yep!
I was able to "fix" it by upgrading the desk client to the latest
Great! Glad to hear it.
I actually had to revert back to the prev sanity client (6.11.1) and structure (2.36.2) to keep things working properly. It broke both the rich text editor and the document search
Let’s use greetings like “Hey Everyone,” “Hi, Y’all," or “Hello, Folks” to make sure everyone in the community is included. Please read the Sanity Community Code of Conduct to stay updated on expected communication & behavior in our spaces: https://www.sanity.io/docs/community-code-of-conduct
Have you folks been seeing this anywehre else?
Looks like this deployed (left) and locally like (right)
user A
this is back and happening specifically in prod on our nextjs prod build. in dev it works OK. No console / browser errors.
What are you embedding it in? Can you share more details about your build?
This is within nextjs 14.2.0. Pretty standard config.

"use client";

import { NextStudio } from "next-sanity/studio";
import config from "../../../sanity.config";

export default function Studio() {
  return <NextStudio config={config} />;
}

// page
import Studio from "./Studio";

export const dynamic = "force-static";

export default function StudioPage() {
  return <Studio />;
}
Are there any errors in the console?
Also, as a side note, please do not DM team members here or on other platforms for assistance.
There are no errors within the console. No console / browser errors. Other notes: we use PNPM and Node v 20 if that matters!
I did DM knut, but only to share a code snippet / example that he asked for in replies that I couldn't publicly share
It’s odd that you mentioned there were no code changes before this started happening. Do you get the same behavior across different browsers?
Your best bet is to probably upgrade both Sanity and Next to their latest versions, delete node modules, reinstall, then redeploy.
Will give that a go! We did see it both in Safari and Chrome.
There was also a weird thing happening with styled components in the last few weeks that could be happening here. If what I suggested previously doesn’t work, try manually installing the latest version of styled components and do the whole reinstall/redeploy but again.
Ah, will give that a try as well.
Running NextJS 14.2.2, latest version of styled-components, latest sanity version 3.38.0, next-sanity 9.0.8, sanity client ^6.15
That finally worked
😮‍💨
Heck yeah, brother!

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?