
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can help you with this "Module not found: Can't resolve 'react-dom/server'" error in your Sanity Studio schemas. This is a known issue that occurs because Sanity Studio's build process doesn't include server-side modules by default, even though you have react-dom installed.
Based on a troubleshooting thread from the Sanity community, here's the solution:
Instead of importing react-dom/server using the standard package import, use a relative path to your node_modules folder:
// Instead of this:
import ReactDOMServer from "react-dom/server";
// Use this:
import ReactDOMServer from '../../node_modules/react-dom/server'You'll need to adjust the relative path (../../) based on where your schema file is located. For example:
studio/schemas/objects/, use ../../../node_modules/react-dom/serverstudio/schemas/, use ../../node_modules/react-dom/serverSanity Studio's webpack configuration doesn't automatically resolve server-side React modules like react-dom/server because the Studio runs in the browser. The build process excludes these server-specific modules to keep the bundle size down and avoid compatibility issues.
Before implementing this workaround, consider whether you actually need server-side rendering in your Studio schema. The use case in the linked thread was trying to convert React icons to SVG strings for storage. Depending on your needs, you might want to:
renderToString() in the StudioThis keeps your Studio schemas simpler and avoids the module resolution issue entirely. But if you do need the server-side rendering capability, the relative path import should resolve your error.
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