slice-machine icon indicating copy to clipboard operation
slice-machine copied to clipboard

Slicemachine process error when saving model to filesystem

Open samuelhorn opened this issue 3 years ago • 1 comments

Versions

  • slice-machine-ui: 0.1.2
  • node: 16.13.0

Reproduction

Only local for now

Additional Details
Storybook related modules
...
"@nuxtjs/storybook": "^4.2.0",
"@storybook/addon-actions": "^6.4.4",
"@storybook/vue": "^6.3.12",
...

Steps to reproduce

  1. Install slice machine in new Nuxt project as described here
  2. Install storybook by running npm i @nuxtjs/storybook @storybook/addon-actions @storybook/vue
  3. Create a new slice and save the model to filesystem.

What is expected?

Model to be saved without errors.

What is actually happening?

Model is saved, but when generating screenshot slicmachine process quits with following error:

[slice/save]: Updating slice model

[slice/save]: Generating mocks

[slice/save]: Generating stories

[slice/save]: Generating screenshots previews

[slice-machine] node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:412:11)
    at Object.spawn (node:child_process:698:9)
    at BrowserRunner.start (/Users/essisuomalainen/Desktop/Projekt/projekt-huset/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:80:34)
    at ChromeLauncher.launch (/Users/essisuomalainen/Desktop/Projekt/projekt-huset/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:94:16)
    at async Object.handleStorybookPreview (/Users/essisuomalainen/Desktop/Projekt/projekt-huset/node_modules/slice-machine-ui/build/server/src/api/common/storybook.js:54:21)
    at async Object.generateForVariation (/Users/essisuomalainen/Desktop/Projekt/projekt-huset/node_modules/slice-machine-ui/build/server/src/api/previews.js:35:28)
    at async Object.generateForSlice (/Users/essisuomalainen/Desktop/Projekt/projekt-huset/node_modules/slice-machine-ui/build/server/src/api/previews.js:18:17)
    at async handler (/Users/essisuomalainen/Desktop/Projekt/projekt-huset/node_modules/slice-machine-ui/build/server/src/api/slices/save.js:38:31)
    at async /Users/essisuomalainen/Desktop/Projekt/projekt-huset/node_modules/slice-machine-ui/build/server/src/api/index.js:80:21 {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'
}

samuelhorn avatar Dec 03 '21 09:12 samuelhorn

Hi @samuelhorn I was having the same issue, but using Next rather than Nuxt. Are you using an M1 Macbook? I discovered this thread and found manually setting the PUPPETEER_EXECUTABLE_PATH resolved the process crashing for me.

Here's my updated slicemachine npm script.

"slicemachine": "PUPPETEER_EXECUTABLE_PATH=\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" start-slicemachine",

Jamesford avatar Jan 21 '22 15:01 Jamesford