Slices without fields/with empty fields cannot be saved anymore on Prismic

Hello everyone,

I have been using slices without fields, creating and pushing them via Slicemachine. Just today, I have noticed that it is not possible to save pages with such slices on Prismic anymore. Not only that, even if I add a field with a default value, I can't save it when it's added, I specifically have to type in something. Tried adding a boolean type field and same issue arises again - I have to move the boolean switch in order to be able to save.

An example slice (with a "fake" field, just to make it work):

Error, that I get from Prismic, after trying to save page with a slice that has empty fields or no fields:
Screenshot 2023-01-20 at 15.21.00
Response:
Screenshot 2023-01-20 at 15.21.33

Have there been any recent updates or changes that may have caused this behaviour? I work on quite a big project, that has been using empty slices (as placeholders for displaying hardcoded or fetched data) for a long time and we had no such issues before.

Would greatly appreciate any comments or help! <3

1 Like

Hello @eve.draugelyte

Welcome to the Prismic community, and thanks for reaching out to us.

I have tested the use case with my project and repository, and it worked well (Screenshot attached).
One with the empty slice:

One with Boolean field:

Are you still getting the issue? If so, Could you please share the repo URL with me? (You can share via private message)

Thanks,
Priyanka

I also see this issue. I had a slice that did not have any fields previously save/publish fine. But some time in the past month, the field cannot be added to a custom type without returning an error when saving:
400: List(JsError(List((/key/value,List(ValidationError(error.expected.jsstring,WrappedArray()))))))

Following up, adding a field to that slice, the page still can't be saved until that field is interacted with.

Hello everyone, I'm having this message "Error while saving your change - Click to retry" when I try to save a document. It only happens when one particular slice is called. This slice is empty, there is no primary or repeatable value attached to it. All the content of the slice is managed in my frontend.

When I try to save, the prismic API sends back a 400 error with this body :

Unable to save version:
List(JsError(List((/key/value,List(ValidationError(error.expected.jsstring,WrappedArray())))))).

What is weird is that I use the same exact slice in other pages and it used to work perfectly. It still is displaying the slice for the old pages, but I can't create a new one with this slice. Maybe the issue is on your side ? Let me know please !

Hello @alexandreguedj @ianboyte, This is a known behavior, and I have already raised this question to my Slice Machine team. I haven't heard back from them yet. I will;l come back to you once I hear from them.

Can you please confirm the version of the slice-machine-ui?

Thanks,
Priyanka

version 0.6.1

Having the same issue across multiple projects. This is the response I get:

Unable to save version: 
List(JsError(List((/key/value,List(ValidationError(error.expected.jsstring,WrappedArray()))))))

Using slicemachine 0.6.1

Can you reproduce the error if you have a slice with a field, i.e. a text field, that is empty like this one?

Hello, I have tested it and can reproduce the issue. I have created an issue in our issue tracker. Thanks.

1 Like

Great to hear! :smiley: Thank you!

Hello, @ianboyte @eve.draugelyte @studio3 @alexandreguedj It should be good now. You can save empty slices too.

2 Likes

Everything seems to work fine now : ) Thank you guys!

Working great! Thank you! :vulcan_salute: