Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

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?