Color Input Plugin Throwing Unnamed Type Error in Studio

28 replies
Last updated: Jan 27, 2026
Hello again! Trying to get the Color input plugin to work in studio. It’s throwing an unnamed type error though I’ve followed the instructions as presented in the docs and am using
all:part:@sanity/base/schema-type
and concatenating my own schema like so:
types: schemaTypes.concat([…])
Note that I couldn’t install it via
sanity install
but instead
npm install
but it still shows up as a dependency when I run
sanity versions
AI Update

The issue you're encountering is likely because you're using Studio v2 patterns (all:part:@sanity/base/schema-type, sanity install) in what might be a Studio v3+ environment. The color input plugin and schema registration work quite differently between these versions.

The Problem

In Studio v2, plugins were installed with sanity install and schema types were registered using the parts system with all:part:@sanity/base/schema-type. However, Studio v3 (and v4, the current version) completely removed the parts system and changed how plugins and schemas work.

The "unnamed type" error typically occurs when a schema type isn't properly registered or when there's a mismatch between how the plugin exports its type and how your schema imports it.

The Solution

For Studio v3+, you need to:

  1. Install the color input plugin via npm (which you've already done):

    npm install @sanity/color-input
  2. Import and register the plugin in your schema configuration directly in your sanity.config.ts (or sanity.config.js):

    import {defineConfig} from 'sanity'
    import {colorInput} from '@sanity/color-input'
    import {schemaTypes} from './schemas'
    
    export default defineConfig({
      // ... other config
      plugins: [
        colorInput(), // Register the plugin here
        // ... other plugins
      ],
      schema: {
        types: schemaTypes, // Just your schema types, no concat needed
      },
    })
  3. Use the color type in your schema:

    {
      name: 'favoriteColor',
      title: 'Favorite Color',
      type: 'color', // The type is now available
    }

Key Differences from v2

  • No more schemaTypes.concat() with parts - you just pass your schema types directly
  • Plugins are registered in the plugins array in your config file, not concatenated into schema types
  • sanity install is deprecated - use npm install (which you correctly did)
  • The plugin itself registers its types automatically when you add it to the plugins array

If you're still seeing the error after this, make sure you've:

  • Restarted your dev server after installing the plugin
  • Added colorInput() to your plugins array in sanity.config.ts
  • Are using the correct type name ('color') in your schema definitions

The fact that sanity versions shows it as a dependency is fine - that command just reads from your package.json, which is correct since you installed it via npm. The key is making sure the plugin is registered in your config file's plugins array, not in the schema types.

Show original thread
28 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.

Was this answer helpful?