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

Add a workaround for an issue where puppeteer fails to find a matching element #770

Closed nodaguti closed 1 year ago

nodaguti commented 1 year ago

Closes #712.

This PR adds a workaround for an issue where puppeteer throws an error when finding an element specified by click or focus options if storycap is used with React 18.

I was not able to dig into a root cause for the issue but found that running an empty function within a page prevents the issue with no side effects.

Though we are using an old version of puppeteer-core due to #545, the issue is still reproduced even if puppeteer-core gets updated to its latest.

nodaguti commented 1 year ago

@Quramy I would be grateful if you would have time to look into this PR. Thank you in advance.

nodaguti commented 1 year ago

Thanks!