Studio crashes on /studio/desk in production but works locally
The crash you're experiencing with /studio/desk in production is likely related to your Node.js version being below the minimum requirement. Your Node.js 16.20.0 is below what Sanity Studio needs to run properly.
Understanding the Node.js Version Issue
According to the official Sanity documentation, Sanity Studio v3 requires Node.js 18 or higher, and Studio v4 requires Node.js 20 or higher. Node.js 16 reached end-of-life, and modern tooling that Studio depends on (like Vite) requires Node 18+ to function properly.
Why It Works Locally But Not in Production
This is the key to your issue - the fact that it works locally but crashes in production suggests an environment mismatch:
- Your local development environment may be using a different Node version than what you think. Check your actual running version with
node -vin the terminal where you runnpm run dev - Your production environment is strictly enforcing Node 16.20.0, which causes the crash
- Development servers can sometimes be more forgiving with certain compatibility issues, or you might have a local Node version manager (like nvm) that's using a different version
About the "Workspace: missing context value" Error
The "Workspace: missing context value" error is a known issue that has appeared when embedding Studio into Next.js apps, particularly when there are version mismatches or build configuration issues. In that GitHub issue thread, users reported the same error with various Node versions, and it was often related to how the Studio was being bundled in production versus development.
How to Fix This
1. Upgrade your Node.js version in production:
For your production environment, you need to specify Node.js 18 or higher (20+ is recommended):
- Vercel: Add to your
package.json:"engines": { "node": "20.x" } - Netlify: Create a
.nvmrcfile with20, or setNODE_VERSION=20in environment variables - Other platforms: Check your hosting provider's documentation for specifying Node versions
2. Verify your local Node version:
Run node -v in your terminal to confirm what version you're actually using locally. If it's 18+, that explains why local works but production doesn't.
3. Update your local development environment:
Even though it works locally now, you should upgrade to Node 20+ to match production and ensure consistency:
# If using nvm
nvm install 20
nvm use 204. Clear build caches and reinstall:
After upgrading Node, clean your dependencies:
rm -rf node_modules .next
npm install
npm run buildOnce you've upgraded Node.js in your production environment to version 20 or higher and redeployed, the /studio/desk route should work consistently across both environments.
Show original thread3 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.