DocumentTypeList Error - ID is Required for Document Nodes

1 replies
Last updated: Jun 16, 2022
I'm getting the attached error
id is required for document nodes
when I click on the panel icon in a document (see picture for context).Looking at the
doc suggested in the error and adding an
call after
breaks the access to the documents' data when I click them in the documentTypeList (I get a form for an unpublished/new document instead of the previously saved data).The plugin I'm using for the content of the panel is "sanity-plugin-documents-pane" the problem might come from somewhere else.
My deskstructure.js looks like this:

export default () =>
// ... cut out some more items from the array. The problem is Isolated within the following item:
// adding a ".id('whatever-id')" here will make the error disappear but prevent me to edit previously saved data, instead a form for a
// new document is seen when want to edit a document. Is it the wrong place?
                      query: `*[!(_id in path("drafts.**")) && references($id)]`,
                      params: { id: `_id` },
                      useDraft: false
                    .title('Incoming References')
I've tested on versions
(latest) with same results.
Jun 16, 2022, 11:11 AM
Fixed exporting a
function and putting the DocumentsPane code there. Example available in this Github issue:
Jun 16, 2022, 12:06 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.

Was this answer helpful?