Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Await exposeFunction in CapturingBrowser #631

Closed
Jamie5 opened this issue Oct 3, 2022 · 1 comment · Fixed by #632
Closed

Await exposeFunction in CapturingBrowser #631

Jamie5 opened this issue Oct 3, 2022 · 1 comment · Fixed by #632

Comments

@Jamie5
Copy link
Contributor

Jamie5 commented Oct 3, 2022

In https://github.com/reg-viz/storycap/blob/master/packages/storycap/src/node/capturing-browser.ts we currently call exposeFunction without awaiting the result. It seems better to await it for several reasons

  1. The puppeteer documentation shows awaiting of the method in e.g. https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.page.exposefunction.md
  2. The answer here: https://stackoverflow.com/questions/64922568/error-evaluation-failed-invalid-arguments-should-be-exactly-one-string-pup suggests that not awaiting can lead to an error which looks similar to something I ran into
  3. When adding an await, it seems like issues I had running storycap manually just went away
@Mike-Dax
Copy link
Contributor

I've hit this error as well, I've made a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants