Parsing error in `schemas` folder, potential linter issue
This is typically a VSCode/ESLint configuration issue rather than a Sanity-specific problem. Since your studio is working fine in development and the error only appears in your editor, it's a tooling issue with how ESLint is trying to parse your files.
First, identify what's actually causing the error:
The error message suggests ESLint is trying to use Babel to parse your schema files but can't find the necessary dependencies. Before installing anything, check what ESLint configuration you're actually using:
- Look in your
package.jsonfor anyeslint-config-*packages - Check your
.eslintrc(or.eslintrc.json,.eslintrc.js) file to see what you're extending
Common solutions to try:
1. VSCode ESLint working directory issue (especially relevant since you moved directories)
If you're in a monorepo or moved your studio folder, VSCode's ESLint extension might be looking for dependencies in the wrong place. Add this to your .vscode/settings.json in your studio directory:
{
"eslint.workingDirectories": [
{ "mode": "auto" }
]
}Or specify the studio directory explicitly if it's nested:
{
"eslint.workingDirectories": [
"./studio"
]
}2. Clear caches and reinstall
Since you moved the directory, stale references might be causing issues:
rm -rf node_modules package-lock.json
npm installThen restart VSCode completely.
3. Install the missing dependencies only if you confirm they're needed
Only do this if your ESLint config explicitly requires Babel parsing. Check your .eslintrc for parser: '@babel/eslint-parser' or similar. If it's there:
npm install --save-dev @babel/preset-env @babel/preset-react4. Disable ESLint for schemas if it's not adding value
If you don't need linting on your schema files (they're mostly configuration), you can tell ESLint to skip them. Add to your .eslintrc.json:
{
"ignorePatterns": ["schemas/"]
}5. Reload the ESLint server in VSCode
Open the command palette (Cmd/Ctrl + Shift + P) and run "ESLint: Restart ESLint Server"
The key here is that this is an editor/linting configuration issue, not a Sanity problem. Since everything works in development, you're not blocked from building or deploying. The most likely culprit is VSCode's ESLint extension looking for dependencies in the wrong location after you moved the directory, which the workingDirectories setting should resolve.
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.