πŸ‘€ Our most exciting product launch yet πŸš€ Join us May 8th for Sanity Connect

Error in resolving document actions in Sanity.io project.

8 replies
Last updated: Aug 17, 2022
Hi πŸ‘‹ I'm trying to follow this tutorial, but are getting an error in
/node_modules/@sanity/desk-tool/lib/panes/document/DocumentPaneProvider.js
when running
sanity start
. The error is
Module not found: Error: Can't resolve 'part:@sanity/base/document-actions/resolver'
in
node_modules/@sanity/desk-tool/lib/panes/document
. Any help would be appreciated πŸ™
Aug 15, 2022, 2:07 PM
Hey
user T
! Can you share your
sanity.json
and your
resolveDocumentActions.js
?
Aug 15, 2022, 5:16 PM
sanity.json
:

{
  "root": true,
  "project": {
    "name": "Prescription"
  },
  "api": {
    "projectId": "******",
    "dataset": "production"
  },
  "plugins": [
    "@sanity/base",
    "@sanity/components",
    "@sanity/default-layout",
    "@sanity/default-login",
    "@sanity/desk-tool",
    "@sanity/dashboard",
    "order-documents",
    "scheduled-publishing"
  ],
  "env": {
    "development": {
      "plugins": ["@sanity/vision"]
    }
  },
  "parts": [
    {
      "name": "part:@sanity/base/schema",
      "path": "./schemas/schema"
    },
    {
      "name": "part:@sanity/desk-tool/structure",
      "path": "src/deskStructure.js"
    },
    {
      "implements": "part:@sanity/base/document-actions/resolver",
      "path": "resolveDocumentActions.js"
    }
  ]
}
Aug 16, 2022, 7:17 AM
resolveDocumentActions.js
:

// resolveDocumentActions.js

// import the default document actions
import defaultResolve from 'part:@sanity/base/document-actions'

import {HelloWorldAction} from './HelloWorldAction'

export default function resolveDocumentActions(props) {
  return [...defaultResolve(props), HelloWorldAction]
}
Aug 16, 2022, 7:17 AM
user M
☝️ 😊
Aug 16, 2022, 8:10 AM
Any thoughts
user M
? 😊
Aug 16, 2022, 1:33 PM
Hey
user T
! Patience is key around here. If I'm not answering, it's likely that it's the middle of the night for me, since I'm in PST. I promise I'm never purposely ignoring you!
Can you try deleting node_modules and reinstalling?
Aug 16, 2022, 3:44 PM
okay, sorry 😊 I have tried deleting node modules and reinstalling it with
sanity install
, also I tried to reinstall the relevant packages again
Aug 17, 2022, 7:13 AM
Figured it out! I had chosen a wrong path in sanity.json for the resolver file
Aug 17, 2022, 8:28 AM

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?