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.

v1.18.0 Page.pdf - Protocol error (IO.read): Invalid parameters handle: string value expected

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.18.0
  • Platform / OS version: AWS Lambda / Amazon Linux
  • Node.js version: 8.10

What steps will reproduce the problem?

await page.setContent(HTML);

await page.pdf({
    path: "/tmp/filename.html",
    format: "A4",
    margin: {
        top: 0,
        bottom: 0,
        left: 0,
        right: 0
    },
    preferCSSPageSize: true,
    printBackground: true
});

Stack Trace:

{
    "errorMessage": "Protocol error (IO.read): Invalid parameters handle: string value expected",
    "errorType": "Error",
    "stackTrace": [
        "Promise (/var/task/node_modules/puppeteer-core/lib/Connection.js:183:56)",
        "new Promise (<anonymous>)",
        "CDPSession.send (/var/task/node_modules/puppeteer-core/lib/Connection.js:182:12)",
        "Function.readProtocolStream (/var/task/node_modules/puppeteer-core/lib/helper.js:238:37)",
        "<anonymous>",
        "  -- ASYNC --",
        "Page.<anonymous> (/var/task/node_modules/puppeteer-core/lib/helper.js:111:15)",
        "convert (/var/task/convert.js:74:27)",
        "<anonymous>",
        "process._tickDomainCallback (internal/process/next_tick.js:228:7)"
    ]
}

"convert (/var/task/convert.js:74:27)" is where await page.pdf(...); call is.

  1. Lunch await puppeteer.launch();
  2. Browser new page await browser.newPage();
  3. Page set content await page.setContent(HTML)
  4. Page pdf await page.pdf(...);

What is the expected result? PDF saved to /tmp/filename.pdf

What happens instead? Error: Protocol error (IO.read): Invalid parameters handle: string value expected

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
Ilshidurcommented, Nov 5, 2019

I encountered the same issue. Turns out I had Chromium 72.0.3626.121 instead of Chromium 77.0.3865.120 with "puppeteer": "1.19.0" … because I was using the node:12-alpine image in my Dockerfile instead of node:13-alpine.

3reactions
aslushnikovcommented, Jun 21, 2019

Perhaps we should use the bundled Chromium (77.0.3827.0) or Chrome Canary.

@yhatt Either this or use a matching versions of chrome and puppeteer-core

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pdf options: Invalid parameters handle: string value expected ...
I want to convert html to pdf so I am using puppeteer, ... Protocol error (IO.read): Invalid parameters handle: string value expected.
Read more >
How to fix Puppeteer 'Error: Protocol error (Emulation ...
How to fix Puppeteer 'Error: Protocol error (Emulation.setDeviceMetricsOverride): Invalid parameters width: integer value expected; height: ...
Read more >
page.goto() fails with Invalid Parameters : r/learnjavascript
It keeps failing with the stack below and I am not able to figure out what the invalid parameter is. ProtocolError: Protocol error...
Read more >
Known issues with PaperCut MF, NG, Hive, Pocket and ...
This page lists all Known Issues across PaperCut products and includes information ... Print Deploy Client may show "Can't reach this page" error...
Read more >
Fix list for IBM WebSphere Application Server V8.5
PH45688, Changing the WebSphere default protocol to TLS v1.3,TLS v1.2 ... with exception java.io.eofexception: unexpected end of zlib input stream error.
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