puppeteer: [Bug]: headless: true renders page as white.

Bug expectation

I expected the page to be rendered, but it was rendered as a white screenshot. Problem page: https://theopenweb.info

I tried on 3 pages, a popular page, the problem page, a page on the same domain as the problem page. Only the problem page has the issue. The issue only happens when headless is true.

This page has had similar issues in a few libraries using puppeteer. This page seems to have indexing issues on Google. Does Google use puppeteer in headless mode for indexing?

Bug behavior

  • Flaky
  • PDF

Minimal, reproducible example

import puppeteer from 'puppeteer'; // TS/ESM are all supported.
// const puppeteer = require('puppeteer')

(async () => {
// const url = 'https://news.google.com/news/'
const url = 'https://theopenweb.info'
// const url = 'https://theopenweb.info/apps/'

async function test(headless = false) {
  const browser = await puppeteer.launch({ headless });
  const page = await browser.newPage();
  await page.goto(url);
  await page.screenshot({path: (headless ? 'headless_' : '') + 'screenshot.png', fullPage: true});
  await browser.close();
}
await test(true) // headless
await test(false) // not headless
})();

// SAME
// "puppeteer": "1.20.0"
// "puppeteer": "19.7.3"

Error string

no error

Puppeteer configuration

No response

Puppeteer version

19.7.3

Node version

v18.14.1

Package manager

npm

Package manager version

9.3.1

Operating system

Windows

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15

Most upvoted comments

Filed https://crbug.com/1423254 but not 100% sure it is the same issue.

Thanks for the details. Since it is not reproducing well on other machines, perhaps it’s some problem with the current machine. In any case, it does sound like it’s the browser’s gpu problem. And, actually, I seem to be able to reproduce without Puppeteer on the Canary build of Chromium:

/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --headless --screenshot --timeout=10000 https://theopenweb.info

on Windows it would be

path\to\chrome.exe --headless --screenshot --timeout=10000 https://theopenweb.info

I will file the issue with crbug.com.

Hey, thanks for the report but I am unable to reproduce. I get the full screenshot in both modes. https://user-images.githubusercontent.com/399150/223946980-ecae631f-2769-4cd2-8172-2b64d7dfcb4b.png