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.

Atempt to open a page with `headless: true` and userDataDir relative path hangs with high CPU load

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.9.0-post (chromium_revision 599821)
  • Platform / OS version: Windows 7 x64
  • URLs (if applicable): any?
  • Node.js version: 11.0.0 (or 12.0.0-v8-canary)

What steps will reproduce the problem?

This script is OK:

'use strict';

const puppeteer = require('puppeteer');

(async function main() {
  try {
    const browser = await puppeteer.launch({
      headless: true,
    });
    const [page] = await browser.pages();

    await page.goto('https://example.org/');

    console.log(await page.evaluate(() => document.title));

    await browser.close();
  } catch (err) {
    console.error(err);
  }
})();

This hangs with high CPU load and no error messages:

'use strict';

const puppeteer = require('puppeteer');

(async function main() {
  try {
    const browser = await puppeteer.launch({
      headless: true,
      userDataDir: 'test-profile-dir',
    });
    const [page] = await browser.pages();

    await page.goto('https://example.org/');

    console.log(await page.evaluate(() => document.title));

    await browser.close();
  } catch (err) {
    console.error(err);
  }
})();

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:22 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
voglercommented, Aug 8, 2019

Can’t launch just call resolve on userDataDir? Just wondered why my script that ran under macOS didn’t do anything under Windows… Disabled headless and it worked. Then found this. Hangs on navigation: { userDataDir: 'user_data', headless: true }. Workaround: { userDataDir: resolve('user_data'), headless: true }.

3reactions
kanxue660commented, Oct 29, 2018

I have the same problem when i set userDataDir,Very high CPU consumption

Read more comments on GitHub >

github_iconTop Results From Across the Web

Atempt to open Canary in headless mode and user data dir ...
Issue 900952: Atempt to open Canary in headless mode and user data dir relative path hangs with high CPU load on Windows. Reported...
Read more >
How to open a Chrome Profile through --user-data-dir ...
This loads the browser with my profile like i want, but the browser then hangs for 60 seconds and times out without advancing...
Read more >
Chrome --user-data-dir not working properly?
What you can do is 1. Copy your current User Data folder (with said guest profile) to a NEW DIRECTORY 2. Point chrome...
Read more >
Advanced configuration - GitLab Docs
Absolute path to a directory where build caches are stored in context of selected executor. For example, locally, Docker, or SSH. If the...
Read more >
Arma 3: Startup Parameters - Bohemia Interactive Community
Steam. Choose the game in Steam\Library; Right click on the game; Select properties; Hit "Set launch options".
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