Hey! When after creating a new project `sanity init` (with empty schema), I get this error when I run `sanity start` : ```Warning in ./node_modules/@sanity/ui/dist/es/atoms/icon/icon.js 16:9...

6 replies
Last updated: Dec 10, 2020
Hey!When after creating a new project
sanity init
(with empty schema), I get this error when I run
sanity start
:
Warning in ./node_modules/@sanity/ui/dist/es/atoms/icon/icon.js
16:9-14 "export 'default' (imported as 'icons') was not found in '@sanity/icons'
 @ ./node_modules/@sanity/ui/dist/es/atoms/icon/icon.js
 @ ./node_modules/@sanity/ui/dist/es/atoms/icon/index.js
 @ ./node_modules/@sanity/ui/dist/es/atoms/textInput/textInput.js
 @ ./node_modules/@sanity/ui/dist/es/atoms/textInput/index.js
 @ ./node_modules/@sanity/ui/dist/es/atoms/index.js
 @ ./node_modules/@sanity/ui/dist/es/index.js
 @ ./node_modules/@sanity/base/lib/components/SanityRoot.js (part:@sanity/base/sanity-root)
 @ ./node_modules/@sanity/server/lib/browser/entry-dev.js
 @ multi ./node_modules/normalize.css/normalize.css ./node_modules/@sanity/server/lib/browser/entry-dev.js
I think it's linked with the latest release of the Studio.
AI Update

This error is happening because you're accidentally running Sanity Studio v2 instead of v3. The warning about @sanity/icons default export and references to @sanity/base with the parts system (part:@sanity/base/sanity-root) are telltale signs of the older v2 architecture.

Here's what's likely happening: even though you ran sanity init, your project somehow got initialized with v2 dependencies instead of v3. This can happen if you have an older version of the Sanity CLI installed globally.

To fix this:

  1. Update the Sanity CLI globally:
npm install -g @sanity/cli@latest
  1. Delete your current project and create a fresh one:
# Remove the project directory
rm -rf your-project-folder

# Create a new project with the updated CLI
sanity init
  1. Alternatively, if you want to keep the project, manually upgrade to v3:
    • Delete node_modules and package-lock.json (or yarn.lock)
    • Update your package.json to use Sanity Studio v3 dependencies (should be sanity@^3.x instead of @sanity/core and other v2 packages)
    • Run npm install again

How to verify you're on v3:

  • Your package.json should have "sanity": "^3.x" as a dependency
  • You should not see @sanity/base, @sanity/core, or @sanity/desk-tool in your dependencies (these are v2 packages)
  • Your config file should be sanity.config.ts or sanity.config.js, not sanity.json

The issue you're seeing is that @sanity/icons removed its default export in newer versions, but v2's @sanity/ui still tries to import it the old way, causing this compatibility mismatch. Studio v3 uses the modern import structure and doesn't have this problem.

If you continue having issues after updating the CLI and reinitializing, check that you don't have any old Sanity packages cached or lingering in your global npm/yarn cache.

Thanks for sharing Jérôme! Indeed, this was a bug in
2.1.0
that should be fixed in
2.1.1
. I'll check with the team to make sure the fix covers
sanity init
as well.
Thanks for sharing Jérôme! Indeed, this was a bug in
2.1.0
that should be fixed in
2.1.1
. I'll check with the team to make sure the fix covers
sanity init
as well.
Thanks for the quick reply! 😃After running
sanity upgrade
, I still get the warning.
Looks like this one's on us then 🙂 Thanks for confirming
no worries, it's just a warning. Studio works fine.🙂
Thanks for the quick fix ! I'm going to introduce Sanity to a team tonight and I didn't want to have warnings popup in the console 😅

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?