Troubleshooting an error with @sanity/desk-tool/structure plugin

14 replies
Last updated: Jun 3, 2021
Hey! How do I resolve this issue? I have tried a lot of things now. Deleted node_modules and reinstalled, upgraded sanity and all plugins, copied code from another working project to make sure the syntax is correct ++. But I always get this error.
Jun 3, 2021, 9:49 AM
Have you made sure you deleted & reinstalled the node_modules from you sanity folder, not the root of the React project?On the same note is
part:@sanity/desk-tool/structure
installed in your
sanity.json
?
How are you using the structure plugin?
Jun 3, 2021, 10:18 AM
Yes, did delete ALL node_modules. Just did it once more now, and same issue. Here is my `sanity.json`:
Jun 3, 2021, 10:21 AM
Hmm, make sure you are on the latest Sanity version with
$ sanity upgrade
. And then try to rebuild the client (from root folder)
npm install --save @sanity/client
. Else try to remove the plugin to see if it works without it.
Jun 3, 2021, 10:34 AM
Hi
user F
- in addition to removing your
node_modules
folder, have you also removed your lock files (
package-lock.json
and
yarn.lock
) before reinstalling?
Jun 3, 2021, 10:38 AM
I’m also a bit unsure why its trying to find
desk-tool/structure
in your root project. It should definitely try and get it from your Sanity root modules.
At least in my build, there is no link to
desk-tools
in the
@sanity
folder:
Jun 3, 2021, 10:38 AM
Hi
user F
- in addition to removing your
node_modules
folder, have you also removed your lock files (
package-lock.json
and
yarn.lock
) before reinstalling?
Jun 3, 2021, 10:38 AM
I’m also a bit unsure why its trying to find
desk-tool/structure
in your root project. It should definitely try and get it from your Sanity root modules.
Jun 3, 2021, 10:38 AM
Hmm, make sure you are on the latest Sanity version with
$ sanity upgrade
. And then try to rebuild the client (from root folder)
npm install --save @sanity/client
. Else try to remove the plugin to see if it works without it.
Jun 3, 2021, 10:34 AM
Hmm. Still same issue. Tried deleting `node_modules`in all folders, and
yarn.lock
, updated
@sanity/client
on frontend, did the
sanity upgrade
.
Jun 3, 2021, 10:43 AM
Tried
yarn remove
and
sanity uninstall
and reinstalled
@sanity/desk-tool
. Still same issue. 😕
Jun 3, 2021, 10:57 AM
Running out of ideas. I definitely think its still related node_modules/things installed in the wrong place. Maybe try a different node version: I’m on
node/14.17.0
Jun 3, 2021, 11:16 AM
I can do that, but I tested another project with the same setup, and that works. I even copied everything from there, line by line.
Should
@sanity/desk-tool
be installed with yarn or
sanity install
or anything?
Jun 3, 2021, 11:41 AM
Finally figured it out 🤪 I was thinking maybe
sanity deploy
would give some different error message. And it did. And it showed me there was a spelling error in the
deskStructure.ts
file! 😅
The error message from
sanity start
was really cryptic though. So sort of led me astray.
Jun 3, 2021, 12:29 PM
Good thinking to run a different command to get more information. I agree the original error message was far from useful here - something we should look into 🙂 Glad you figured it out!
Jun 3, 2021, 1:12 PM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the 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?