Issue with structure-builder module in Sanity.io project
14 replies
Last updated: Jun 11, 2022
A
[NOT SOLVED]Hello everyone, hope you are all doing great. I have an issue with structure-builder and hope someone could give me a help with it. I was following
https://www.sanity.io/guides/getting-started-with-structure-builder , but I can't seem to make it work. Issue I am facing is :
Module not found: Error: Can't resolve 'part:@sanity/desk-tool/structure?'
I tried researching more about this module, but any help I found online didn't work for me. Could someone please aid me with this ?
https://www.sanity.io/guides/getting-started-with-structure-builder , but I can't seem to make it work. Issue I am facing is :
Module not found: Error: Can't resolve 'part:@sanity/desk-tool/structure?'
I tried researching more about this module, but any help I found online didn't work for me. Could someone please aid me with this ?
Jun 11, 2022, 11:54 AM
K
Did you define the part in your Sanity.json and a file at that path exists?
Jun 11, 2022, 1:47 PM
A
{ "root": true, "project": { "name": "digitale-grundung" }, "api": { "projectId": "xxxxxxxx", "dataset": "production" }, "plugins": [ "@sanity/base", "@sanity/components", "@sanity/default-layout", "@sanity/default-login", "@sanity/dashboard", "@sanity/desk-tool" ], "env": { "development": { "plugins": [ "@sanity/vision" ] } }, "parts": [ { "name": "part:@sanity/desk-tool/structure", "path": "./deskStructure.js" }, { "name": "part:@sanity/base/schema", "path": "./schemas/schema" } ] }
Jun 11, 2022, 2:02 PM
A
this would be my structure of sanity.json
Jun 11, 2022, 2:02 PM
K
And
deskStructure.jsexists?
Jun 11, 2022, 2:03 PM
A
Yes, this is how it looks :
Jun 11, 2022, 2:03 PM
A
import S from '@sanity/desk-tool/structure-builder' export default () => S.list() .title('Contents') .items( S.documentTypeListItems() )
Jun 11, 2022, 2:03 PM
A
pretty basic stuff to make it start working, would customize it further after
Jun 11, 2022, 2:03 PM
K
It looks good. Even with a restart, it doesn‘t work?
Jun 11, 2022, 2:09 PM
A
Sadly, not. Tried removing
node_modulesas well, didn't help. Always getting
Module not found: Error: Can't resolve 'part:@sanity/desk-tool/structure?'
Jun 11, 2022, 2:12 PM
A
Would you mind sharing your structure in
node_modules/@sanity/desk-tools/
Jun 11, 2022, 2:13 PM
K
If you search for this in your codebase, do you have more hits than just the
sanity.jsonone?
Jun 11, 2022, 2:13 PM
A
This issue is being triggered inside of . Full issue is :
/node_modules/@sanity/structure/lib/parts/userStructure.js
Module not found: Error: Can't resolve 'part:@sanity/desk-tool/structure?' in '/home/aljosa/Documents/projects/xxxxxx/frontend/sanity/node_modules/@sanity/structure/lib/parts'
Jun 11, 2022, 2:15 PM
K
Which version of Sanity are you using?
Jun 11, 2022, 2:27 PM
A
@sanity/cli version 2.30.0
Jun 11, 2022, 2:28 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.