
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeIt sounds like you're running into CSS import issues when trying to use the markdown plugin with the Sanity blog starter! This is a known issue with the plugin, especially when embedding Sanity Studio in Next.js applications.
The error you're seeing (Global CSS cannot be imported from within node_modules) is a documented issue that affects the plugin when used with Next.js. Here's what's happening and how to fix it:
The sanity-plugin-markdown plugin tries to import CSS from within node_modules, which Next.js doesn't allow by default. This affects both older versions (with react-mde) and the current v3 version (which uses @uiw/react-md-editor).
Option 1: Use the latest version (if you haven't already) Make sure you're using the latest version of the plugin:
npm install sanity-plugin-markdown@latestThe v3 version switched from react-mde to @uiw/react-md-editor, but some CSS import issues may still exist.
Option 2: Workaround for embedded Studio If you're embedding the Studio in Next.js (which seems likely given the blog starter context), one user found success by:
_app.js or _app.tsxconst MarkdownEditor = dynamic(() => import('./your-markdown-component'), {
ssr: false,
loading: () => <div>Loading...</div>,
});Option 3: Consider alternatives If the markdown plugin continues to give you trouble, you might want to consider:
text field with markdown formatting handled on the frontendBe aware that the current v3 version of the plugin has also dropped drag-and-drop image upload support, so you'll need to manually add image URLs if you need images in your markdown.
If you share more details about your specific setup (Studio version, how you're embedding it, etc.), I can provide more targeted guidance!
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store