question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when trying to edit a slice via Slice Builder UI

See original GitHub issue

Version

  • Prismic CLI version (know it by running prismic --version): 3.8.8

Reproduction

  1. Run Slice Builder using prismic sm --develop

  2. Open Slice Builder at http://localhost:9999/ and access my first created slice (via prismic sm --create-slice)

  3. 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:

Screen Shot 2021-03-08 at 17 11 23

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pablogiraltcommented, Mar 8, 2021

thanks @lihbr! closing this

0reactions
lihbrcommented, Mar 8, 2021

Oh great! Glad you figured it out~

Indeed Slice Machine requires v12 now at least, we’ll have some warning enforcing that pretty soon 🙂

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found