title: Puppeteer error: Navigation failed because browser has disconnected
body: <p>I am using puppeteer on Google App Engine with Node.JS</p>
  <p>whenever I run puppeteer on app engine, I encounter an error saying</p>
  <p>Navigation failed because browser has disconnected!</p>
  <p>This works fine in local environment, so I am guessing it is a problem with app engine.</p>
  <pre><code>const browser = await puppeteer.launch({
      ignoreHTTPSErrors: true,
      headless: true,
      args: [&quot;--disable-setuid-sandbox&quot;, &quot;--no-sandbox&quot;],
  });
  </code></pre>
  <p>This is my app engine's app.yaml file</p>
  <pre><code>runtime: nodejs12
  
  env: standard
  
  handlers:
    - url: /.*
      secure: always
      script: auto
  </code></pre>
  <p>-- EDIT--</p>
  <p>It works when I add <code>--disable-dev-shm-usage</code> argument, but then it always timeouts. Here are my codes.</p>
  <pre><code>const browser = await puppeteer.launch({
    ignoreHTTPSErrors: true,
    headless: true,
    args: [
      &quot;--disable-gpu&quot;,
      &quot;--disable-dev-shm-usage&quot;,
      &quot;--no-sandbox&quot;,
      &quot;--disable-setuid-sandbox&quot;,
      &quot;--no-first-run&quot;,
      &quot;--no-zygote&quot;,
      &quot;--single-process&quot;,
    ],
  });
  const page = await browser.newPage();
  
  try {
    const url = &quot;https://seekingalpha.com/market-news/1&quot;;
    const pageOption = {
      waitUntil: &quot;networkidle2&quot;,
      timeout: 20000,
    };
  
    await page.goto(url, pageOption);
  } catch (e) {
    console.log(e);
    await page.close();
    await browser.close();
    return resolve(&quot;error at 1&quot;);
  }
  
  try {
    const ulSelector = &quot;#latest-news-list&quot;;
    await page.waitForSelector(ulSelector, { timeout: 30000 });
  } catch (e) {
    // ALWAYS TIMEOUTS HERE!
    console.log(e);
    await page.close();
    await browser.close();
    return resolve(&quot;error at 2&quot;);
  }
  ...
  </code></pre>