Issue with compiling studio, resolved by nuking node_modules and installing with `sanity install`

4 replies
Last updated: Aug 21, 2020
Anyone else getting this while trying to get the studio compiled

can't access property "style", popper is undefined
AI Update

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 install

2. Clear build caches:

# Clear npm cache
npm cache clean --force

# If using Yarn
yarn cache clean

3. 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 -v

5. Update Sanity packages:

npm install sanity@latest

If 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-deps

Additional 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.

There is some dependency issue going in (we’re looking into it as soon as the team is up and about). Try nuking node_modules and install with
sanity install
again?
There is some dependency issue going in (we’re looking into it as soon as the team is up and about). Try nuking node_modules and install with
sanity install
again?
Ah. I nuked node_modules before and ran
npm install
which didn’t fix it. but
sanity install
has
aha - sorry about the friction and glad you got it sorted 🙌

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?