Hello! I'm following along on the step by step instructions for using slice machine with next.js here: Developer Documentation - Prismic
I've created a new slice and added an image to it. Added the image to my component and now its showing up in storybook. The next step is to push slice to prismic (so I can add content) and I'm getting the following error in terminal and the push slice to prismic button just hangs. Screenshot: https://nikib.ro/wn/screenshots/localhost9999slicesSimpleHtml_2020-11-23_14-10-32.jpg
[slice-machine] [api/slices] An error occured while fetching slices. Note that when stable, this should break!
[slice-machine] {
e: TypeError: res.text is not a function
at _callee2$ (/Users/nikibrown/Code/my-slicemachine-project/node_modules/slice-machine-ui/server/api/push.js:54:35)
at tryCatch (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:293:22)
at Generator.next (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:118:21)
at asyncGeneratorStep (/Users/nikibrown/Code/my-slicemachine-project/node_modules/slice-machine-ui/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/Users/nikibrown/Code/my-slicemachine-project/node_modules/slice-machine-ui/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
}
[slice-machine] (node:262) UnhandledPromiseRejectionWarning: RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined
at ServerResponse.writeHead (_http_server.js:248:11)
at ServerResponse._implicitHeader (_http_server.js:239:8)
at write_ (_http_outgoing.js:642:9)
at ServerResponse.end (_http_outgoing.js:753:5)
at ServerResponse.send (/Users/nikibrown/Code/my-slicemachine-project/node_modules/express/lib/response.js:221:10)
at ServerResponse.json (/Users/nikibrown/Code/my-slicemachine-project/node_modules/express/lib/response.js:267:15)
at _callee6$ (/Users/nikibrown/Code/my-slicemachine-project/node_modules/slice-machine-ui/server/api/index.js:55:39)
at tryCatch (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:293:22)
at Generator.next (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:118:21)
(node:262) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:262) [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.
Since I could not push I made a new slice in my prismic instance and then tried to pull. When I run prismic sm --pull nothing seems to happen besides showing me all the commands:
Seeing different errors now when I try to push slice to prismic:
> my-slicemachine-project@0.1.0 slicemachine /Users/nikibrown/Code/my-slicemachine-project
> start-slicemachine --port 9999
[slice-machine] Launching server
[slice-machine] Now running on http://localhost:9999 !
[slice-machine] [api/slices] An error occured while fetching slices. Note that when stable, this should break!
[slice-machine] {
e: Error: ENOENT: no such file or directory, open '/Users/nikibrown/Code/my-slicemachine-project/slices/SimpleHtml/preview.png'
at Object.openSync (fs.js:458:3)
at Object.readFileSync (fs.js:360:35)
at Object.base64Sync (/Users/nikibrown/Code/my-slicemachine-project/node_modules/base64-img/base64-img.js:60:17)
at _callee2$ (/Users/nikibrown/Code/my-slicemachine-project/node_modules/slice-machine-ui/server/api/push.js:46:34)
at tryCatch (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:293:22)
at Generator.next (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:118:21)
at asyncGeneratorStep (/Users/nikibrown/Code/my-slicemachine-project/node_modules/slice-machine-ui/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/Users/nikibrown/Code/my-slicemachine-project/node_modules/slice-machine-ui/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/Users/nikibrown/Code/my-slicemachine-project/slices/SimpleHtml/preview.png'
}
}
[slice-machine] (node:19972) UnhandledPromiseRejectionWarning: RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined
at ServerResponse.writeHead (_http_server.js:248:11)
at ServerResponse._implicitHeader (_http_server.js:239:8)
at write_ (_http_outgoing.js:642:9)
at ServerResponse.end (_http_outgoing.js:753:5)
at ServerResponse.send (/Users/nikibrown/Code/my-slicemachine-project/node_modules/express/lib/response.js:221:10)
at ServerResponse.json (/Users/nikibrown/Code/my-slicemachine-project/node_modules/express/lib/response.js:267:15)
at _callee6$ (/Users/nikibrown/Code/my-slicemachine-project/node_modules/slice-machine-ui/server/api/index.js:55:39)
at tryCatch (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:293:22)
at Generator.next (/Users/nikibrown/Code/my-slicemachine-project/node_modules/regenerator-runtime/runtime.js:118:21)
(node:19972) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
[slice-machine] (node:19972) [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.```
When I try to edit my slices and add new fields I see this error:
`Could not connect to Storybook. Make sure Storybook is running and its url is set in SliceMachine configuration.` Story book is definitely running when I click on "Open in Storybook"
We're working on debugging the slice-machine-ui alpha. Niki, it looks like we solved part of the push issue, but now there's an issue with generating previews.
The dev team has released a new version that might address this. Could you try updating to: 0.0.43-alpha.1 and let me know if that helps?
I'm not sure if I'm hijacking this thread, but I am facing [slices API]: Not Found when trying to run prismic sm --develop [slices API]: Not Found and was told to try out a bunch of stuff on this thread and continue the conversation here.
I've logged in and out of the tool but still face [slices API]: Not Found. I read here about having the slice API activated on Prismic's side, is that something that we're missing? our repo is docsportal.prismic.io