Szpadel / chrome-headless-render-pdf

225 stars 67 forks source link

TypeError: Browser.getVersion is not a function #26

Closed seveibar closed 6 years ago

seveibar commented 6 years ago

I'm on Arch Linux, installed via npm install chrome-headless-render-pdf. Command doesn't work programmically or via cli, I suspect this was introduced recently, because older versions work fine.

seveibar commented 6 years ago

Resolved by reverting to 1.5.0, that is, via npm install chrome-headless-render-pdf@1.5.0

seveibar commented 6 years ago

My guess is this commit introduced the bug

Szpadel commented 6 years ago

Can you provide more details? How can I reproduce it?

seveibar commented 6 years ago
npm init
npm install chrome-headless-render-pdf
chmod +x ./node_modules/chrome-headless-render-pdf/cli/chrome-headless-render-pdf.js
./node_modules/chrome-headless-render-pdf/cli/chrome-headless-render-pdf.js --url http://google.com --pdf out.pdf

Output:

Using google-chrome
Waiting for chrome to became available
Connected!
(node:4917) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Browser.getVersion is not a function
(node:4917) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Chrome version: Google Chrome 60.0.3112.78

Szpadel commented 6 years ago

Should be fixed in 1.6.0

Szpadel commented 6 years ago

Ps. executable version is installed in node_modules/.bin/ and it is also available in PATH in npm scripts. Also you can execute it with yarn from command line: yarn chrome-headless-render-pdf