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.

Protocol Error @ Page.printToPDF

See original GitHub issue

I’m getting the error below when running relaxed on a simple test file. This is a fresh vagrant box that I installed for relaxed, but I had the same issue in another box that I was using for development. Node is at version v11.30, npm at 6.4.1

I tried with one of the examples provided and got the same error.

Launching ReLaXed...

Processing /test.pug...
... HTML generated in 0.1s
... Document loaded in 0.1s
... Network idled in 0.2s
(node:18412) UnhandledPromiseRejectionWarning: Error: Protocol error (Page.printToPDF): Invalid parameters displayHeaderFooter: boolean value expected
    at Promise (/home/vagrant/.nvm/versions/node/v11.3.0/lib/node_modules/relaxedjs/node_modules/puppeteer/lib/Connection.js:186:56)
    at new Promise (<anonymous>)
    at CDPSession.send (/home/vagrant/.nvm/versions/node/v11.3.0/lib/node_modules/relaxedjs/node_modules/puppeteer/lib/Connection.js:185:12)
    at Page.pdf (/home/vagrant/.nvm/versions/node/v11.3.0/lib/node_modules/relaxedjs/node_modules/puppeteer/lib/Page.js:911:39)
    at Page.<anonymous> (/home/vagrant/.nvm/versions/node/v11.3.0/lib/node_modules/relaxedjs/node_modules/puppeteer/lib/helper.js:145:23)
    at exports.masterToPDF (/home/vagrant/.nvm/versions/node/v11.3.0/lib/node_modules/relaxedjs/src/masterToPDF.js:140:14)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
(node:18412) 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(). (rejection id: 1)
(node:18412) [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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
bussoloncommented, Jan 6, 2019

I had the same error. I changed header || footer in (header !== '') || (footer !== '') and solved the problem. I hope this may help.

// displayHeaderFooter: header || footer,
displayHeaderFooter: (header !== '') || (footer !== ''),
Read more comments on GitHub >

github_iconTop Results From Across the Web

Protocol error (Page.printToPDF): Target closed. · Issue #2735 ...
chromium-browser goes 100% CPU at page.pdf() and after 35s: { Error: Protocol error (Page.printToPDF): Target closed. at Promise (/home/jon/ ...
Read more >
ProtocolError: Protocol error (Page.printToPDF): Printing is not ...
PDF creation is only supported in headless mode. So this should work: const browser = await Puppeteer.launch({ headless: true });.
Read more >
Protocol error (Page.printToPDF): Target closed. - jsreport forum
I Seem to be getting this error quite a lot after updating to version 2.5.0: Protocol error (Page.printToPDF): Target closed.
Read more >
[Ultimate PDF] Protocol error(Page.navigate) - OutSystems
Hello,. We are having issues with generating PDF's since the last update. The error we get is;. Protocol error(Page.navigate): Target closed.
Read more >
About to lose my mind trying to get Page.printToPDF to work ...
https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF. chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {.
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