Skip to content

Fix timeout parameter

-t, --timeout has no effect. No matter the value puppeteer's default timeout value of 30000 ms is used. The timeout time shall be passed to puppeteer to

  • Set a custom timeout value (e.g. --timeout 50000)
  • Disable timeout (e.g. --timeout 0)

Puppeteer has a default timeout of 30000 ms. I reach this time easily when printing 100+ pages. After the timeout error the page either

  • loads indefinitely
  • loads and then renders indefinitely

Exception:

# Use timeout of 10 ms
>PS: pagedjs-cli .\print.html --timeout 10

- Loading: .\print.htmlTimeoutError: Navigation timeout of 30000 ms exceeded
    at C:\Users\user\AppData\Local\Yarn\Data\global\node_modules\puppeteer\lib\LifecycleWatcher.js:142:21
  -- ASYNC --
    at Frame.<anonymous> (C:\Users\user\AppData\Local\Yarn\Data\global\node_modules\puppeteer\lib\helper.js:111:15)
    at Page.goto (C:\Users\user\AppData\Local\Yarn\Data\global\node_modules\puppeteer\lib\Page.js:672:49)
    at Page.<anonymous> (C:\Users\user\AppData\Local\Yarn\Data\global\node_modules\puppeteer\lib\helper.js:112:23)
    at Printer.render (C:\Users\user\AppData\Local\Yarn\Data\global\node_modules\pagedjs-cli\src\printer.js:85:18)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Printer.pdf (C:\Users\user\AppData\Local\Yarn\Data\global\node_modules\pagedjs-cli\src\printer.js:226:16)
    at async C:\Users\user\AppData\Local\Yarn\Data\global\node_modules\pagedjs-cli\bin\paged:137:14
/ Loading: .\print.html