sanity icon indicating copy to clipboard operation
sanity copied to clipboard

Studio crashes when changing the type of a field with uploaded file

Open xndyz opened this issue 5 years ago • 3 comments
trafficstars

Describe the bug

To Reproduce

Steps to reproduce the behavior:

  1. Create a schema like so:
type Masthead implements Document {
    name: String!
    file: File!
  }
  1. Create a document Masthead and upload an SVG asset to it, then publish
  2. Change new schema to:
type Masthead implements Document {
    name: String!
    file: Image!
  }
  1. Go to the document you created, and you should now get:

image

Expected behavior

Changing the field type should not break the Studio. It's extra annoying because when you only have one Masthead document, clicking on Masthead content type auto selects the first document, which has the broken asset. This breaks the page which means you can't remove the asset to fix the error.

xndyz avatar Feb 11 '20 02:02 xndyz

I managed to fix this by deleting using the CLI: sanity documents delete 315daa88-cee0-47b6-abae-1067683ac9f2

xndyz avatar Feb 11 '20 03:02 xndyz

Thanks for reporting! You should've got a better error message than this, and preferably, pointers to how to fix it. I've noted this down in our internal issue tracker.

kmelve avatar Feb 11 '20 04:02 kmelve

I just encountered this error as well when changing a field type from string to portable text - super inconvenient.

Asingerdev avatar Jun 27 '22 21:06 Asingerdev

Hi!

We are currently working on improving our workflows and follow-up on our open GitHub repository. In that work, we have decided to close most issues older than the release of Sanity Studio v3.

We value your feedback, so if this issue is still important to you and relevant for Sanity Studio v3, please search for relevant open issues. If you can’t find any, open a new one and link to relevant comments in this thread. For questions about how to do something, please post them in the slack community.

kmelve avatar Jan 11 '23 21:01 kmelve