Error when trying to edit a slice via Slice Builder UI
See original GitHub issueVersion
- Prismic CLI version (know it by running
prismic --version
): 3.8.8
Reproduction
-
Run Slice Builder using
prismic sm --develop
-
Open Slice Builder at http://localhost:9999/ and access my first created slice (via
prismic sm --create-slice
) -
Add a new field and click on Save model to filesystem
What is expected?
I expect new field to be saved
What is actually happening?
Feld is not being saved and error appears in terminal:
[slice-machine] [update]: generating mocks
[slice-machine] (node:49124) UnhandledPromiseRejectionWarning: TypeError: content.flat is not a function
at createMockFromConfig (/Users/pablo/jamstack/peanutbutter-site/node_modules/slice-machine-ui/lib/widgets/StructuredText/Mock/index.js:75:18)
at handleMockConfig (/Users/pablo/jamstack/peanutbutter-site/node_modules/slice-machine-ui/lib/widgets/StructuredText/Mock/index.js:83:10)
at handleFieldMock (/Users/pablo/jamstack/peanutbutter-site/node_modules/slice-machine-ui/lib/mock/handlers.js:23:12)
at fields.reduce (/Users/pablo/jamstack/peanutbutter-site/node_modules/slice-machine-ui/lib/mock/handlers.js:41:20)
at Array.reduce (<anonymous>)
at /Users/pablo/jamstack/peanutbutter-site/node_modules/slice-machine-ui/lib/mock/handlers.js:36:17
at model.variations.map.variation (/Users/pablo/jamstack/peanutbutter-site/node_modules/slice-machine-ui/lib/mock/index.js:15:20)
at Array.map (<anonymous>)
at default (/Users/pablo/jamstack/peanutbutter-site/node_modules/slice-machine-ui/lib/mock/index.js:12:39)
at handler (/Users/pablo/jamstack/peanutbutter-site/node_modules/slice-machine-ui/server/api/update.js:77:29)
[slice-machine] (node:49124) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:49124) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Any additional information
If I access my storybook for this slice I see this error:
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Solved: Slice data shows up as error - Google Cloud Community
I have tried creating a fresh new spreadsheet with a completely new gmail account, just to add new slice but same error came...
Read more >Troubleshooting Slice Machine - Developing with Prismic
These issues are likely because you're not on the right version of slice-machine-ui . Change to 0.0.42. Error: 413. Try: Update slice-machine-ui.
Read more >An Error that e.slice Is Not a Function Occurs - Documentation
The error indicates that the response which is received from the remote data source is not an array while the widget expects a...
Read more >reactjs - how to modify the state of another slice from pending ...
I am building a simple application. I am using redux toolkit for state management. It has to query the database ...
Read more >Releases · prismicio/slice-machine - GitHub
UX · Buttons in Slice Machine have been reworked to keep consistent across the whole application · We removed the unused burger menu...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thanks @lihbr! closing this
Oh great! Glad you figured it out~
Indeed Slice Machine requires v12 now at least, we’ll have some warning enforcing that pretty soon 🙂