🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Parsing error in `schemas` folder, potential linter issue

12 replies
Last updated: Mar 5, 2022
Wondering if anyone else has run into this — I have an error popping up only in my
schemas
folder for some reason:
Parsing error: Cannot find module '@babel/preset-env'
Not entirely sure what’s causing it, I’ve tried googling the error and making suggested changes to my various config files but so far nothing I’ve tried helps. I’m not super familiar with what’s going on behind the scenes with some of these node packages that come with Sanity so any guidance would be appreciated.

For what it’s worth, I moved this
studio
directory from a different directory, and everything seems to be working fine at least in development (data and sanity studio are working fine on localhost:3333 and in local front end), but I can’t figure out what’s causing this parsing error.
Jan 27, 2022, 11:06 PM
I can confirm the module is definitely in there
Jan 27, 2022, 11:14 PM
looks like this. maybe I’m missing something?
Jan 27, 2022, 11:19 PM
It doesn't look like anything there is causing it. Do you have a
.babelrc
or
babel.config.json
in your project?
Jan 27, 2022, 11:45 PM
I don’t think so, that wouldn’t go in the
node_modules
right?
Jan 27, 2022, 11:48 PM
No, it would have been something you set up in the root of your Studio. Hmm, I'll keep exploring.
Jan 28, 2022, 12:00 AM
No, it would have been something you set up in the root of your Studio. Hmm, I'll keep exploring.
Jan 28, 2022, 12:00 AM
Was there a resolution to this?I am having the same issue, clean install of Sanity from the cli.
Feb 8, 2022, 8:16 AM
So far I haven't found any — I can check again later today if the issue is still happening but so far it hasn't prevented anything from working. Could be a linter issue?
Feb 8, 2022, 6:51 PM
I’m having this issue too on a clean install from CLI v2.27.0. At this stage, it seems limited to a linter issue. Did anyone find a solution?
Feb 22, 2022, 11:07 PM
If others are still having this issue, my fix was related to the way VS Code deals with opening a project with multiple sub projects
Project
|--- /web
Mar 5, 2022, 9:55 PM
If others are still having this issue, my fix was related to the way VS Code deals with opening a project with multiple sub projects
Project
|--- /web
Mar 5, 2022, 9:55 PM
If others are having this error, my issue was related to the way VS Code deals with a project containing multiple ESLint working directories (common in monorepos).
For example:

Project
   |--- /web
   |--- /studio
Edit`./.vscode/settings.json` to include my ESLint projects
"eslint.workingDirectories": ["./web", "./studio"]
.
Hope that helps :-)
Mar 5, 2022, 10:01 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?