reg-viz / storycap

A Storybook Addon, Save the screenshot image of your stories :camera: via puppeteer.
https://www.npmjs.com/package/storycap
MIT License
705 stars 89 forks source link

Support Chromium newest versions #896

Closed stanislav215 closed 1 week ago

stanislav215 commented 2 weeks ago

From Chromium 128.0.6613.18 version, getting error:

/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:194 reject(new Error([ ^

Error: Failed to launch the browser process!

Related to package: "puppeteer-core": "^9.0.0" in storycap/packages/storycrawler

Please add support.

K-kind commented 2 weeks ago

I encountered a similar issue in my project after the Chrome version of GitHub Actions was updated yesterday. The following error caused Storycap to stop working:

TimeoutError: Navigation timeout of 60000 ms exceeded

As a temporary solution, it can be fixed using the previous version of Chrome.

- name: Install Chrome
        id: chrome
        uses: browser-actions/setup-chrome@facf10a55b9caf92e0cc749b4f82bf8220989148 # v1.7.2
        with:
          chrome-version: 127
- name: Take Screenshots
  env:
    CHROME_PATH: ${{ steps.chrome.outputs.chrome-path }}
  run: npm run ci:screenshot

package.json

"ci:screenshot": "storycap http://localhost:6007 --chromiumPath $CHROME_PATH --serverCmd 'http-server storybook-static --ci -p 6007'"
debiru commented 1 week ago

Today, I encountered this problem in my projects.

My project is running Storybook v6.5 and v7.x, and we will updating to Storybook v8.x.

It appears that this problem occurs with the latest version of Chrome (128) in combination with Storybook v8.x.

Storybook Chrome 127 Chrome 128
v6.5 OK OK
v7.x OK OK
v8.x OK Occured this problem

I would like to get a solution.

Quramy commented 1 week ago

Hi.

I'm investigating this issue. But I still can't find how to fix this.

I can reproduce the following error, which is the same message of https://github.com/reg-viz/storycap/issues/896#issuecomment-2317248668:

TimeoutError: Navigation timeout of 60000 ms exceeded

See #901 for details.

Quramy commented 1 week ago

@K-kind @debiru

I suppressed the navigation timeout error on Chromium 128 and shipped as pre-patch version, https://www.npmjs.com/package/storycap/v/5.0.1-alpha.0 .

Would you try this and check if your timeout error goes away?

k35o commented 1 week ago

@Quramy I had the same problem, but was able to solve it by using the 5.0.1-alpah.0 version.Thanks for shipping!

This error does not occur for webpack based Storybook. It only occurs for Storybook built by Vite

As written above, I'm using a webpack based Storybook and I get the same error.

Quramy commented 1 week ago

@k35o

I had the same problem, but was able to solve it by using the 5.0.1-alpah.0 version.Thanks for shipping!

Thanks for your reply 😄 I'll merge #902 and ship storycap@5.0.1 soon.

Quramy commented 1 week ago

@stanislav215 (and others)

I've closed this issue, but I could not reproduce your " Error: Failed to launch the browser process! " rejection. I fixed only the navigation timeout error problem(https://github.com/reg-viz/storycap/issues/896#issuecomment-2317248668)

If you're encountering the Failed to launch the browser process!, please re-open this issue. 🙏