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.

[Bug]: executablePath fails in puppeteer 19+ on windows

See original GitHub issue

Bug description

Steps to reproduce the problem:

  1. Use puppeteer 19+ on windows
  2. Try to call puppeteer.executablePath()

Expected result: path to puppeteer executable

Actual result:

TypeError: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:372:5)
    at validateString (node:internal/validators:120:11)
    at join (node:path:429:7)
    at PuppeteerNode.get defaultDownloadPath [as defaultDownloadPath] (C:\SrcRep\asy-browser-service\node_modules\puppeteer-core\src\node\PuppeteerNode.ts:232:11)
    at ChromeLauncher.resolveExecutablePath (C:\SrcRep\asy-browser-service\node_modules\puppeteer-core\src\node\ProductLauncher.ts:105:28)
    at ChromeLauncher.executablePath (C:\SrcRep\asy-browser-service\node_modules\puppeteer-core\src\node\ChromeLauncher.ts:227:19)
    at PuppeteerNode.executablePath (C:\SrcRep\asy-browser-service\node_modules\puppeteer-core\src\node\PuppeteerNode.ts:213:27)

Puppeteer version v18 and below are unaffected

Puppeteer version

19.2.0

Node.js version

16.16.0

npm version

8.11.0

What operating system are you seeing the problem on?

Windows

Configuration file

No response

Relevant log output

TypeError: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:372:5)
    at validateString (node:internal/validators:120:11)
    at join (node:path:429:7)
    at PuppeteerNode.get defaultDownloadPath [as defaultDownloadPath] (C:\SrcRep\asy-browser-service\node_modules\puppeteer-core\src\node\PuppeteerNode.ts:232:11)
    at ChromeLauncher.resolveExecutablePath (C:\SrcRep\asy-browser-service\node_modules\puppeteer-core\src\node\ProductLauncher.ts:105:28)
    at ChromeLauncher.executablePath (C:\SrcRep\asy-browser-service\node_modules\puppeteer-core\src\node\ChromeLauncher.ts:227:19)
    at PuppeteerNode.executablePath (C:\SrcRep\asy-browser-service\node_modules\puppeteer-core\src\node\PuppeteerNode.ts:213:27)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
dukeicommented, Nov 7, 2022

The problem was in puppeteer-extra.

import puppeteer from "puppeteer-extra";
console.log(puppeteer.executablePath());

results in error with puppeteer v19+, puppeteer-extra v3.3.4

0reactions
jrandolfcommented, Nov 7, 2022

Please open a bug with puppeteer-extra. In general, we recommend posting this on stack overflow and discussing it there until the scope of the issue can be found.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer error: An `executablePath` or `channel` must be ...
It seems like puppeteer-core now requires executablePath as mandatory. Try this: import bypass from './captcha/captchaBypasser.js'; import ...
Read more >
Troubleshooting - Puppeteer
The most common cause is a bug in Node.js v14.0.0 which broke extract-zip , the module Puppeteer uses to extract browser downloads into...
Read more >
Browsershot on Windows: Puppeteer cannot find Chromium
I have Node and NPM installed at the latest versions, and I can install Puppeteer (version 19.2.2) with no issues. Browsershot is required...
Read more >
Error while launching headless browser using puppeteer.
Why I am getting error :failed to launch browser ? ... await puppeteer.launch({ executablePath:'/usr/bin/chromium-browser'}); const page = await browser.
Read more >
How to use Puppeteer inside a Docker container
launch({ args: args, executablePath: '/usr/bin/google-chrome', });. and i get this error "Protocol error (Target.setAutoAttach): ...
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