2

As I was creating my new sanity project on my terminal while running "sanity init" during the process I received an error of:

"Error: No "sanity.json" file found in plugin "@sanity/vision""

I have been trying to solve this error for quite some time. I know it's very similar to this question on Stackoverflow of Error: No "sanity.json" file found in plugin "@sanity/base". The error even suggest I look into this doc on Sanity https://www.sanity.io/help/missing-plugin-sanity-json. I have tried to do all the solutions . I deleted my node_modules folder and ran the "sanity install" command. It did not work. I tried deleting the whole project and create a new one and I still recieved the error. I tried following that sanity document on what I should do(Although I did not I understand what they wanted me to do) it still did not work.

Here is the error message:

Error: No "sanity.json" file found in plugin "@sanity/vision"
See https://docs.sanity.io/help/missing-plugin-sanity-json
    at handleManifestReadError (C:/Users/Bernadette Kotelo/Documents/Projects/Renanit's Art Portfolio/server/node_modules/@sanity/resolver/lib/readManifest.js:27:11)
    at C:/Users/Bernadette Kotelo/Documents/Projects/Renanit's Art Portfolio/server/node_modules/@sanity/resolver/lib/readManifest.js:56:60
    at async Promise.all (index 4)

Can anyone please help me understand and solve this error. Thank you

MegaMindTheCoder
  • 125
  • 3
  • 12

2 Answers2

1

Make sure you are using an up to date node version, I get this error when I ran sanity init using 14v, try deleting your project and run sanity init with node v18.2.0 or higher.

jahkoora
  • 58
  • 5
  • 1
    Using node 18.12.1, this doesn't work. – Paul McClean Jun 08 '23 at 22:30
  • 1
    @Paul McClean I also realised when you use their documentation on setting your project it throws the error. Maybe their documantion is old but however there is this guy I follow on youtube, we were making a sanity project and he gave us this link in the description https://www.sanity.io/javascriptmastery his free boosted plan worked for me . Try following the link and just click the big blue Get Started. jahkoora solution worked for me but maybe try the link. – MegaMindTheCoder Jun 09 '23 at 09:46
1

Check your sanity.json file, and remove the section below:

  "env": {
    "development": {
      "plugins": [
        "@sanity/vision"
      ]
    }
  },

Sanity Vision is a plugin for Sanity Studio for testing GROQ queries but does not contain a sanity.json file in the plugin folder. Therefore, the env file can't find the @sanity/vision sanity.json.

Tiarnan
  • 115
  • 1
  • 10