puppeteer: TypeError: Cannot read property 'send' of null

Steps to reproduce

Unsure of repo.

Tell us about your environment:

  • Puppeteer version: 0.11.0
  • Platform / OS version: Ubuntu Zesty docker: ubuntu:zesty-20170915

What steps will reproduce the problem?

Open page, ???, close page

What is the expected result?

closes page

What happens instead?

      "TypeError: Cannot read property 'send' of null",
      "    at Session.dispose (/usr/src/app/node_modules/puppeteer/lib/Connection.js:204:27)",
      "    at Page.close (/usr/src/app/node_modules/puppeteer/lib/Page.js:655:24)",
      "    at <redacted>:26:16",
      "    at Generator.throw (<anonymous>)",
      "    at step (/usr/src/app/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)",
      "    at /usr/src/app/node_modules/babel-runtime/helpers/asyncToGenerator.js:30:13",
      "    at <anonymous>",
      "    at process._tickDomainCallback (internal/process/next_tick.js:228:7)"

About this issue

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

Most upvoted comments

import _ from 'lodash/fp';
import puppeteer from 'puppeteer';

const extraFlags = [
  '--no-sandbox',
  '--disable-web-security',
];

const launch = _.once(() => puppeteer.launch({ args: extraFlags }));

async function create(html) {
  const browser = await launch();
  const page = await browser.newPage();
  try {
    await page.setJavaScriptEnabled(false);
    await page.goto(`data:text/html,${html}`, { waitUntil: 'networkidle' });
    return await page.pdf({ printBackground: true, scale: 0.63 });
  } finally {
    await page.close();
  }
}

@vsemozhetbyt but it’s intermittent