
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThe issue you're experiencing is that you're trying to use an old plugin designed for Sanity Studio v2, but the error and your code structure suggest you're working with a modern version of Sanity. The plugin you mentioned (sanity-plugin-inline-svg) and the type name svgUploadPreview are from an outdated plugin that's no longer compatible.
The good news is there's a modern, actively maintained version of this plugin for Sanity Studio v3!
You need to use @focus-reactive/sanity-plugin-inline-svg-input instead. Here's how to fix your setup:
# Remove the old plugin
sanity uninstall sanity-plugin-inline-svg
# Install the modern plugin
npm install @focus-reactive/sanity-plugin-inline-svg-inputsanity.config.js (or .ts)Add the plugin to your Sanity configuration:
import { defineConfig } from 'sanity'
import { inlineSvgInput } from '@focus-reactive/sanity-plugin-inline-svg-input'
export default defineConfig({
// ... your other config
plugins: [
inlineSvgInput(),
// ... your other plugins
],
})schemas/goal.js)Change the field type from svgUploadPreview to inlineSvg:
import { GiArcheryTarget as icon } from 'react-icons/gi';
export default {
name: 'goal',
title: 'Objectifs',
type: 'document',
icon,
fields: [
{
name: 'svgUpload',
title: 'Icône',
type: 'inlineSvg', // Changed from 'svgUploadPreview'
},
{
name: 'title',
title: 'Titre',
type: 'string',
},
{
name: 'list',
title: 'Liste de capacités',
type: 'array',
of: [{ type: 'string' }],
},
],
};You no longer need to import anything in your schema file - the plugin registers the type globally when added to your config. Remove this line from your goal.js:
import svgUploadPreview from 'sanity-plugin-inline-svg'; // Remove thisThe old sanity-plugin-inline-svg plugin (which used the svgUploadPreview type) was built for Sanity Studio v2. Your code structure using part:@sanity/base/schema-creator confirms you were following v2 patterns, but if you're on a newer Sanity version, you need the v3-compatible plugin.
The modern plugin uses the type name inlineSvg instead of svgUploadPreview, and it's installed and configured differently to work with Sanity Studio v3's architecture.
If you want to display SVG previews in array fields, the new plugin includes a handy component called InlineSvgPreviewItem. Check out the GitHub documentation for examples on how to use it for rich array previews with your SVG icons.
After making these changes, restart your Sanity Studio and you should be good to go! 🎉
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store