Issue with compiling studio, resolved by nuking node_modules and installing with `sanity install`
I understand you're running into the "can't access property 'style', popper is undefined" error when trying to compile Sanity Studio. This is a frustrating build-time error that typically points to dependency resolution issues.
While I can't find specific documentation about this exact error message in Sanity's official docs, this type of error generally occurs when there are problems with how your package manager is resolving dependencies during the build process. Here are the most reliable troubleshooting steps:
General Troubleshooting Steps
1. Clean install of dependencies:
# Remove existing dependencies
rm -rf node_modules
rm package-lock.json # or yarn.lock if using Yarn
# Reinstall
npm install
# or
yarn install2. Clear build caches:
# Clear npm cache
npm cache clean --force
# If using Yarn
yarn cache clean3. Try a different package manager:
Based on community experiences, some developers have resolved similar dependency issues by switching between npm and Yarn. If you're using Yarn, try npm (or vice versa).
4. Check your Node.js version:
Make sure you're using a compatible Node.js version. Sanity Studio v3+ requires Node.js 18 or later, and Studio v4 requires Node.js 20+. Check with:
node -v5. Update Sanity packages:
npm install sanity@latestIf Using npm 7+
If you're on npm 7 or higher and encountering peer dependency conflicts, you can try the legacy peer deps flag:
npm install --legacy-peer-depsAdditional Context
Since this specific error can have various root causes, it would help to know:
- Which version of Sanity Studio you're running
- Your Node.js and package manager versions
- Whether this is a new project or an existing one that stopped working
- Any recent changes to dependencies or plugins
If the above steps don't resolve it, I'd recommend checking the Sanity Slack community or creating a support ticket with more details about your setup, as this may be related to a specific plugin or configuration in your project.
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.