Describe the bug
Getting a crash in studio when clicking on docs from the dashboard document list that are in draft and were never published. I am uploading docs through the api with drafts. prepended to the id so they stay as drafts and not published and this is working fine if you go through the normal flow of the document panes but if you click from the dashboard it crashes with error editOpsOf does not expect a draft id
To Reproduce
Steps to reproduce the behavior:
http://localhost:3333/intent/edit/type=student;id=drafts.1221/react_devtools_backend.js:6 Error: editOpsOf does not expect a draft id.Expected behavior
It should load the doc in edit mode like other previously published documents. NOTE this works fine when the document has been published before. Once I publish it this works again. To trigger this it needs to be a newly created doc as a draft before publishing.
Screenshots
If applicable, add screenshots to help explain your problem.

Which versions of Sanity are you using?
Run sanity versions in the terminal and copy-paste the result here.
@sanity/cli 1.149.9 (up to date)
@sanity/base 1.149.10 (up to date)
@sanity/block-content-to-react 2.0.7 (up to date)
@sanity/cli 1.149.9 (up to date)
@sanity/color-input 1.149.7 (up to date)
@sanity/components 1.149.10 (up to date)
@sanity/core 1.149.12 (up to date)
@sanity/dashboard 1.149.10 (up to date)
@sanity/default-layout 1.149.10 (up to date)
@sanity/default-login 1.149.11 (up to date)
@sanity/desk-tool 1.149.10 (up to date)
@sanity/production-preview 1.149.0 (up to date)
@sanity/vision 1.149.0 (up to date)
What operating system are you using?
Which versions of Node.js / npm are you running?
Run npm -v && node -v in the terminal and copy-paste the result here.
Thanks for reporting @zanedev! I'll run this by the Studio working group 馃憤
I've encountered the same issue while updating from ^0.145.0, the draft ID is not being picked up, when we try to open an editor from a custom built structure. In
The editor is loading as expected in version 0.145.0 for draft content, while in newer versions ^1.149.15 is throwing the same error as described.
Experiencing same issue here. Also getting o.useDocumentOperation(...) is null thrown
I don't know if it's an intended behaviour, but passing in the id with omitted drafts (replace('drafts.','')) does the work, it figures out the document published state.
I'm running into this as well. Is there a workaround?
For the sake of future proofing, when generating links in the studio the drafts. prefix for the document id should be removed. The dashboard-widget-document-list plugin was updated with a fix for this in version 0.0.10, so upgrading that package might fix the issue for you.
That said, I've also made a PR for making the studio more resilient and not crash when encountering draft ids in #1930.
Thanks. Updating that package fixed it for me.