PDF generation crashes `pagedjs-cli` on version 0.1.4 and greater
When I attempt to generate a PDF using the attached HTML file, the process gets hung at "Loading" when I execute pagedjs-cli index.html -o result.pdf
. When I execute pagedjs-cli index.html --debug
I get the following error:
$> pagedjs-cli index.html --debug
✔ Processed
(node:49191) UnhandledPromiseRejectionWarning: Error: Protocol error (Runtime.callFunctionOn): Target closed.
at /Users/chrisknight/.nvm/versions/node/v14.17.0/lib/node_modules/pagedjs-cli/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:217:63
at new Promise (<anonymous>)
at CDPSession.send (/Users/chrisknight/.nvm/versions/node/v14.17.0/lib/node_modules/pagedjs-cli/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:216:16)
at ExecutionContext._evaluateInternal (/Users/chrisknight/.nvm/versions/node/v14.17.0/lib/node_modules/pagedjs-cli/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:204:50)
at ExecutionContext.evaluate (/Users/chrisknight/.nvm/versions/node/v14.17.0/lib/node_modules/pagedjs-cli/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:27)
at DOMWorld.evaluate (/Users/chrisknight/.nvm/versions/node/v14.17.0/lib/node_modules/pagedjs-cli/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:91:24)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:49191) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:49191) [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.
I have been able to replicate this on paged-cli
v0.1.4 and greater. It works just fine on v0.1.3. Using node v14.16.0 and have tried on Mac and Ubunbtu.index.htmlindex.html
If I remove the <link href="https://fonts.googleapis.com/css?family=Roboto:wght@400;600" rel="stylesheet" />
line from the HTML, it also works fine in all versions.