Issue with Tags plugin installation and usage in Sanity.io Studio
I can see you're getting a module parse error with @floating-ui/dom when using the Tags plugin. This error typically means your build tool is encountering JavaScript syntax it's not configured to handle properly.
Since Sanity Studio v3 uses Vite as its build tool, you can configure it to handle this dependency through your sanity.config.ts (or .js) file. Here are some steps to troubleshoot:
1. Configure Vite to optimize the dependency
Add a Vite configuration to your sanity.config file:
import {defineConfig} from 'sanity'
export default defineConfig({
// ... your other config (projectId, dataset, plugins, etc.)
vite: {
optimizeDeps: {
include: ['@floating-ui/dom']
}
}
})This tells Vite to pre-bundle and optimize the @floating-ui/dom module during development.
2. Verify your Node.js version
Make sure you're using a compatible Node.js version. Studio v3 requires Node.js 18+, and Studio v4 requires Node.js 20+:
node --version3. Clear your cache and reinstall
Sometimes build artifacts get corrupted:
rm -rf node_modules .sanity
npm install4. Update your dependencies
Ensure you're running recent versions:
npm install sanity@latest
npm update5. Check which tags plugin you're using
There are different tags implementations in the Sanity ecosystem. Run:
npm list | grep tagsIf the Vite configuration doesn't resolve the issue, it's worth checking the plugin's GitHub repository for any reported issues or compatibility notes with your Studio version. You might also want to share your specific setup (Studio version, plugin version, and package.json) in the Sanity Community Slack where others who've encountered similar build errors can help troubleshoot.
The error about needing "an appropriate loader" is a build configuration issue rather than a code problem, so the Vite configuration approach above is the most direct way to address it.
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.