You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a project that uses webpack and typescript, depending on configuration of other node/webpack items, __dirname points to /. This results in a TypeError tracing back to the Browser Launch.
Further investigations show that initializePuppeteerNode isn't setting puppeteerRootDirectory.
The fix for this is to fall back to process.cwd() when pkgDir.sync(__dirname) comes back undefined.
Puppeteer version
13.1.2
Node.js version
14.18.0 & 16
npm version
6.14.15
What operating system are you seeing the problem on?
Linux, macOS, Windows
Relevant log output
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
at new NodeError (internal/errors.js:322:7)
at validateString (internal/validators.js:124:11)
at Object.join (path.js:1148:7)
at new BrowserFetcher (webpack:////Users/codydaig/dev/opensource/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js?:162:22)
at resolveExecutablePath (webpack:////Users/codydaig/dev/opensource/puppeteer/lib/cjs/puppeteer/node/Launcher.js?:610:28)
at ChromeLauncher.launch (webpack:////Users/codydaig/dev/opensource/puppeteer/lib/cjs/puppeteer/node/Launcher.js?:107:57) {
code: 'ERR_INVALID_ARG_TYPE'
}
The text was updated successfully, but these errors were encountered:
This patch fixes __dirname pointing to / in some envrioments by
trying process.cwd() if __dirname returne undefined.
Issues: puppeteer#7085puppeteer#7932
This patch fixes __dirname pointing to / in some envrioments by
trying process.cwd() if __dirname returne undefined.
Issues: puppeteer#7085puppeteer#7932
Bug description
Steps to reproduce the problem:
/
. This results in a TypeError tracing back to the Browser Launch.Further investigations show that initializePuppeteerNode isn't setting puppeteerRootDirectory.
The fix for this is to fall back to process.cwd() when pkgDir.sync(__dirname) comes back undefined.
Puppeteer version
13.1.2
Node.js version
14.18.0 & 16
npm version
6.14.15
What operating system are you seeing the problem on?
Linux, macOS, Windows
Relevant log output
The text was updated successfully, but these errors were encountered: