question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

browser.newPage() is blocked with puppeteer.connect()

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 0.13 + current master branch
  • Platform / OS version: Debian Stretch
  • Uses chrome headless from Docker

What steps will reproduce the problem?

/* eslint-disable no-console, filenames/match-regex, import/no-commonjs */

/**
 * @file Ensure that Chrome can properly start and close.
 */
const puppeteer = require('puppeteer');

const test = async () => {
  console.log('Testing if Chrome works');

  const browser = await puppeteer.connect({
    browserWSEndpoint: 'ws://192.168.200.200:9222/devtools/browser/36b65179-51a0-402b-9dd4-096c808a67c7'
  });
  console.log('Hello! 1');

  const page = await browser.newPage();
  console.log('Hello! 2');

  const navigationPromise = page.waitForNavigation();
  console.log('Hello! 3');

  await page.goto('http://perdu.com/');
  console.log('Hello! 4');

  await navigationPromise;
  console.log('Hello! 5');

  console.log(await page.content());
  console.log('Hello! 6');

  await browser.close();

  console.log('Chrome is working expected.');
};

test();

What is the expected result?

Like in 0.10.0

Testing if Chrome works
Hello! 1
Hello! 2
Hello! 3
Hello! 4
Hello! 5
<html><head><title>Vous Etes Perdu ?</title></head><body><h1>Perdu sur l'Internet ?</h1><h2>Pas de panique, on va vous aider</h2><strong><pre>    * &lt;----- vous êtes ici</pre></strong>
</body></html>
Hello! 6
Chrome is working expected.

What happens instead?

Testing if Chrome works
Hello! 1

And the process is blocked…

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sdeprezcommented, Nov 22, 2017

+1 same issue with latest chrome stable (tried on latest canary chromium too) launched headless, on Ubuntu 16.04. Note that it works fine with puppeteer 0.12.0.

0reactions
aslushnikovcommented, Oct 4, 2018

@yijiem you can install specific version using npm install puppeteer@1.2.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

browser.newPage() is blocked with puppeteer.connect() #1450
The browser.newPage() hangs because you use old version of chromium. If you absolutely can't use the bundled chromium, try using older pptr / ......
Read more >
Puppeteer blocked at .newPage() - node.js - Stack Overflow
I have fixed the issue of my case: Use dumpio: true to display log of Puppeteer. After that, I found the error with...
Read more >
Avoid being blocked with puppeteer - Cobalt Intelligence
Puppeteer stealth is a great tool to help you avoid being blocked while web scraping with puppeteer. Easy to use and is very...
Read more >
Web Scraping with a Headless Browser: A Puppeteer Tutorial
In this article, Toptal Freelance JavaScript Developer Nick Chikovani shows how easy it is to perform web scraping using a headless browser.
Read more >
Puppeteer-extra NPM - npm.io
ConnectOptions? See puppeteer docs. Returns: Promise<Puppeteer.Browser>. Attach Puppeteer to an existing Chromium instance. Augments the original puppeteer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found