puppeteer: slowMo + userDataDir = Error: Protocol error (Browser.close): Target closed.

Tell us about your environment:

  • Puppeteer version: 0.13.0
  • Platform / OS version: macOS 10.13.1
  • URLs (if applicable): https://www.google.com/ (any URLs)

What steps will reproduce the problem?

Please include code that reproduces the issue.

  1. use options slowMo and userDataDir together
  2. browser.close()

the code:

const path = require('path')
const puppeteer = require('puppeteer')

const run = async () => {
  const browser = await puppeteer.launch({
    headless: false,
    slowMo: 250,
    userDataDir: path.join(process.cwd(), 'state'),
  })
  const page = await browser.newPage()
  await page.goto('https://www.google.com/')
  await browser.close()
}

run()

What is the expected result?

close the browser with no exception

What happens instead?

throw UnhandledPromiseRejectionWarning:

  1. Error: Protocol error (Browser.close): Target closed.
  2. AssertionError [ERR_ASSERTION]: false == true

2017-11-20 20 28 29

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 19 (6 by maintainers)

Commits related to this issue

Most upvoted comments

There are good chances this will be fixed as the upstream patch lands: https://chromium-review.googlesource.com/c/chromium/src/+/1000730

@aslushnikov I have also tested with Windows 7, same issue. While puppeteer/.local-chromium binary worked ok for me.