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

[Bug]: puppeteer@15.3.2 cannot take screenshot when set viewport as null #8673

Closed
suym796 opened this issue Jul 19, 2022 · 1 comment · Fixed by #8680 or #8681
Closed

[Bug]: puppeteer@15.3.2 cannot take screenshot when set viewport as null #8673

suym796 opened this issue Jul 19, 2022 · 1 comment · Fixed by #8680 or #8681
Labels

Comments

@suym796
Copy link

suym796 commented Jul 19, 2022

Bug description

Steps to reproduce the problem:

  1. Launch the browser by await puppeteer.launch({ defaultViewport: null })
  2. Get the elementHandle by await page.$(selector)
  3. Run await elementHandle.screenshot()
  4. Throw an error, which point to the null viewport

But when I use puppeteer@13.7.0, it works.

Puppeteer version

15.3.2

Node.js version

16.15.1

npm version

8.11.0

What operating system are you seeing the problem on?

Windows

Relevant log output

{}
       Error
           at assert (file:///d:/workdir/Projects/Cloud%20E2E/cloud-e2e-testing-template/node_modules/puppeteer/lib/esm/puppeteer/common/assert.js:25:15)
           at ElementHandle.screenshot (file:///d:/workdir/Projects/Cloud%20E2E/cloud-e2e-testing-template/node_modules/puppeteer/lib/esm/puppeteer/common/ElementHandle.js:562:9)
           at runMicrotasks (<anonymous>)
           at processTicksAndRejections (node:internal/process/task_queues:96:5)
@suym796 suym796 added the bug label Jul 19, 2022
@pecampelo
Copy link
Contributor

I don't know what you are aiming at with using viewport defined as null, could you explain a bit further? Seems a bit odd to want a screenshot of a null-defined viewport, since the screenshot takes into account the viewport size.

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