Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: control of the timeout #101

Open
lacostej opened this issue Oct 6, 2021 · 1 comment
Open

feature: control of the timeout #101

lacostej opened this issue Oct 6, 2021 · 1 comment

Comments

@lacostej
Copy link

lacostej commented Oct 6, 2021

Problem:

Some of our documents take time to be generated and exceed the default pupeteer 30s timeout.

  ✖ generating PDF from doc.md
    → Navigation timeout of 30000 ms exceeded
ListrError: Something went wrong
    at /usr/local/lib/node_modules/md-to-pdf/node_modules/listr/index.js:102:18
    at async main (/usr/local/lib/node_modules/md-to-pdf/dist/cli.js:118:5) {
  errors: [
    TimeoutError: Navigation timeout of 30000 ms exceeded
        at /usr/local/lib/node_modules/md-to-pdf/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
        at async DOMWorld.setContent (/usr/local/lib/node_modules/md-to-pdf/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:146:23)
        at async Page.setContent (/usr/local/lib/node_modules/md-to-pdf/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:1097:9)
        at async Object.generateOutput (/usr/local/lib/node_modules/md-to-pdf/dist/lib/generate-output.js:14:5)
        at async Object.convertMdToPdf (/usr/local/lib/node_modules/md-to-pdf/dist/lib/md-to-pdf.js:61:20)
  ],
  context: [Object: null prototype] {}
}

Solution:

Either

???

@simonhaenisch
Copy link
Owner

Thanks for the report. I'm wondering whether the best option would be to expose the whole page reference, so that you can define a callback via js config, e. g.

module.exports = {
  afterPageInit: (page) => page.setDefaultNavigationTimeout(60000)
}

But maybe it's also good to provide a global --puppeteer-timeout config option that applies the timeout option for all puppeteer related calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants