How to clean up a corrupt blog post in Studio's desk after it crashes.

11 replies
Last updated: Mar 11, 2021
🔥 I unpublished/deleted a corrupt blogPost doc via Studio's desk, resulting in the post still being listed in studio desk's list view, but when I click on it the desk crashes with
The 'Desk' tool crashed
. Any suggestinos on how to clean this up?
Mar 11, 2021, 9:42 PM
This is my stack trace:

Stack trace:
Error: Invalid path string
    at Object._ [as fromString] (/static/js/app.bundle.js?6ef77456e5ec3ff542e9:1257:52028)
    at t.findMostSpecificTarget (/static/js/app.bundle.js?6ef77456e5ec3ff542e9:1367:87045)
    at <https://etg24.sanity.studio/static/js/app.bundle.js?6ef77456e5ec3ff542e9:1367:85713>
    at Array.map (&lt;anonymous&gt;)
    at <https://etg24.sanity.studio/static/js/app.bundle.js?6ef77456e5ec3ff542e9:1367:85639>
    at to (/static/js/vendor.bundle.js?57bbf5590fb38df8ed50:17:58877)
    at jo (/static/js/vendor.bundle.js?57bbf5590fb38df8ed50:17:68395)
    at Do (/static/js/vendor.bundle.js?57bbf5590fb38df8ed50:17:67729)
    at Io (/static/js/vendor.bundle.js?57bbf5590fb38df8ed50:17:67387)
    at Vu (/static/js/vendor.bundle.js?57bbf5590fb38df8ed50:17:114545)
Mar 11, 2021, 9:43 PM
Is that deleted document path still in your URL?
Mar 11, 2021, 9:43 PM
(it may be a invalid value on the slug field)
Mar 11, 2021, 9:44 PM
noticed that it was a string in the other thread
Mar 11, 2021, 9:44 PM
slug: { current: 'the-slug' }

☝️ slugs should be objects like this
Mar 11, 2021, 9:44 PM
yes it is a string, but it's not in my url anymore.It also still gets listed in the doc list view and crashes as soon as i click it.
Might be able to delete it with the js client, as modifying it with the desk is not an option anymore.
Mar 11, 2021, 9:51 PM
if you're close to the devs, this should be catched if you ask me and i could reproduce it if that helps
Mar 11, 2021, 9:51 PM
You can also edit the JSON directly in a code editor if you run:
sanity documents create --id &lt;the _id&gt; --replace --watch

Mar 11, 2021, 10:00 PM
This sounds great, but what I get when executing this is
{
  "_id": "TYqXdZEMYoJWq965vytff8",
  "_type": "specify-me"
}
Any idea what I'm doing wrong?
Mar 11, 2021, 10:04 PM
sanity documents create --id 'abf5ef5c-fa73-4df7-8bdb-bf3945ba7cf0' --replace --watch
Did you run it like this with the
_id
of the docs you're trying to fix?
Mar 11, 2021, 10:12 PM
Figured it out. It was unpublished, so I had to prepend the id with
drafts.
. Deleted it via client with that and now it's clean
Mar 11, 2021, 10:28 PM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the 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?

Categorized in