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

Full page screenshot fails when defaultViewport is null #3104

Closed
k3mayo opened this issue Aug 17, 2018 · 2 comments · Fixed by #3306
Closed

Full page screenshot fails when defaultViewport is null #3104

k3mayo opened this issue Aug 17, 2018 · 2 comments · Fixed by #3306
Labels

Comments

@k3mayo
Copy link

k3mayo commented Aug 17, 2018

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.7.0
  • Platform / OS version: Windows 7
  • URLs (if applicable):
  • Node.js version: v9.10.1

What steps will reproduce the problem?

const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch({ headless: false, defaultViewport: null });
    const page = await browser.newPage();
    await page.goto('https://www.google.com/');
    await page.screenshot({ path: 'example.png', fullPage: true });
    await browser.close();
})();

What is the expected result?
No error and screenshot is saved.

What happens instead?
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'isMobile' of null

@aslushnikov aslushnikov added the bug label Sep 6, 2018
@yanivefraim
Copy link
Contributor

Trying this gave me a different error:

fullPage screenshots do not work without first setting viewport. (source)

Is this still considered a bug?

@aslushnikov
Copy link
Contributor

@yanivefraim yeah; viewport should not be necessary to do a full-page screenshot.

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

Successfully merging a pull request may close this issue.

3 participants