spiritix / php-chrome-html2pdf

A PHP library for converting HTML to PDF using Google Chrome
MIT License
112 stars 29 forks source link

Problem with page.waitFor #48

Closed Lezhni closed 2 years ago

Lezhni commented 2 years ago

Hi, yesterday I updated Composer packages on server and got this error:

Node.js v18.12.0
 {"exception":"[object] (Spiritix\\Html2Pdf\\ConverterException(code: 0): Binary error: file:///var/www/project/app/vendor/spiritix/php-chrome-html2pdf/lib/Converter.js:79
            await page.waitFor(parseInt(options.pageWaitFor));
                       ^

TypeError: page.waitFor is not a function
    at Converter._convert (file:///var/www/project/app/vendor/spiritix/php-chrome-html2pdf/lib/Converter.js:79:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Converter.run (file:///var/www/project/app/vendor/spiritix/php-chrome-html2pdf/lib/Converter.js:37:24)
    at async file:///var/www/project/app/vendor/spiritix/php-chrome-html2pdf/index.js:23:20

As I found, this error only appears when converter's option pageWaitFor is set.

Node version: 18.12.0 Package version: 1.7.2

Any ideas?

spiritix commented 2 years ago

Thanks for the report. I just released a bugfix version that should handle this.