[slice-machine] [update]: Model was saved but screenshot could not be generated.
[slice-machine] (node:44440) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'C:\projects\vfi-website.slicemachine\assets\slices\SubscribeEbook\preview.png'
at Object.openSync (fs.js:462:3)
at Object.readFileSync (fs.js:364:35)
at Proxy.base64Sync (C:\projects\vfi-website\node_modules\base64-img\base64-img.js:60:17)
at handler (C:\projects\vfi-website\node_modules\slice-machine-ui\server\api/update.js:74:57)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[slice-machine] (node:44440) 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 Command-line options | Node.js v17.2.0 Documentation). (rejection id: 3)
The good news... I followed your instructions and I can upload custom screenshots again. For others reading this, the new version of slicemachine requires node v15 installed. I had to upgrade. This requires the "current" version of node, not the "LTS" version, which is the default download.
The bad news... Storybook runs but now it doesn't find any of my components at all. Before the upgrade it was working. I am on v 6.3.12
Thanks @Fares for investigating and for the workaround you provided. I have found a way to make the latest node version required by slice-machine play nice with my build server, so I don't need to use the workaround.
Thanks, @withloveinternet, for letting us know. It would be great if you could explain how to make the latest node version required by slice-machine play nice with your build server for the benefit of the community.
I use vercel to build my apps, and although you can set the nodejs version used by the build server in settings -they only support 12.x and the LTS (14.x) not the 15 required by slicemachine. I was worried at first, but It seems to build ok even so as Node 15 is only required when running yarn slicemachine locally. People using vercel to build their production apps that use the latest slicemachine should be fine, as long as they can install node 15+ locally to run slicemachine.
The problem came because I want to run local builds of my production app using the same version of node as on the vercel server, so I needed a safe way to switch between node 14 and 15 at will. This isn't supported by node by default. For OSX users the tool to use is NVM (node version manager). I use windows mostly so the best tool to use to switch between node versions is not the original nvm but nvm-windows
For other windows users, watch out for this gotcha when installing nvm-windows. It first gets you to uninstall all node versions on your machine, before installing various node versions via its own cli. Which will also uninstall your windows-build-tools which are required. The only safe way to get the build tools these days is to use the actual node installer. The workflow that eventually worked for me was this:
uninstall all node versions as per nvm instructions
install nvm-windows with cli including the version(s) you want
Then re-run the installer from the node website, this will install the build tools along with the node version. Even though you use the installer to install a specific node version, nvm will still let you switch, but only if you do things in this order
closed as resolved, flag & select 'Something Else' to reopen.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.