Since I upgraded to the prismic-cli v4.2 the sm --create-slice behaves differently in the sense:
it throws a conflict with slices\index.js and asks if it should overwrite it. I usually confirm that it can be overwritten, but i get this question every single time. Any idea how to fix this?
It creates the index.stories.js and mocks.json into the .slicemachine\assets... folder instead in the slices... folder. This causes storybook to not recognize the slice. I can probably easily change this by telling storybook where to search, but I would like to get some advicehow to do it the right way.
Thanks, i updated now slice-machine-ui and when i run prismic sm --develop I get an error that Slicemachine requires node version >=15. To be able to test the website with the same node version as on production, I'm limitted to v12 and v14 though (production is on vercel). Do you have any tips for this issue?
I got another problem as well with the new version - it suddenly doesn't except special characters in field API ID's despite that the standard API fields have all underscores, such as first_publication_date. Why this inconsistency and do i really need to change all fields now?
no, i was referring to the syntax change. I seem to be able to use any syntax when changing the json model itself which prevents that I have to go through all custom types and documents, but it's very disruptive.
Hi Pau, I think you misunderstood. With one of the last versions Slice Machine changed from underscore to camelCase syntax for fields added through the slice machine. Prismic on the other hand still uses underscore syntax. So, right now when I make an API call, I get some fields with underscore and some others with camelCase syntax in the response. And worse - if I created a slice prior one of the last updates of slice machine, it used underscore and if I make any change, the new version just changes the syntax to cancelCase. So, you got inconsistencies as well as further production disruption in case slice machine changes their mind again.
Now I understand. This is a limitation that we are aware of. At the moment we do not have a standardized migration process from Legacy Builder to Slice Machine and unfortunately, this means that, if in the early stages you started out using both builders and now just use Slice Machine, you might run into these inconsistencies.
The only way to solve it is to re-add the fields that previously used underscore syntax and change them to use camelCase. This will imply that the content of the original field is removed. This is a workaround that has drawbacks but it is the workaround available to integrate a single type of syntax into your new Custom Types.