adrienbrignon / mkdocs-exporter

⚡ The fastest and most configurable plugin for MkDocs, allowing seamless export of individual pages and/or entire documentation as PDF documents.
https://adrienbrignon.github.io/mkdocs-exporter/
MIT License
81 stars 8 forks source link

playwright._impl._errors.TimeoutError: Locator.wait_for: Timeout 60000ms exceeded. #36

Closed PhilStollery50Hertz closed 2 months ago

PhilStollery50Hertz commented 2 months ago

Producing a 150 page PDF with covers is causing a timeout issue. Is there a way to increare the playwright timeout in config?

PhilStollery50Hertz commented 2 months ago

If I remove the covers it works.

adrienbrignon commented 2 months ago

Hello @PhilStollery50Hertz,

You should be able to increase the timeout (which defaults to 60000 milliseconds) by using the formats.pdf.browser.timeout option.

Don't hesitate to reach out with any updates on the issue.

PhilStollery commented 2 months ago

Hello @PhilStollery50Hertz,

You should be able to increase the timeout (which defaults to 60000 milliseconds) by using the formats.pdf.browser.timeout option.

Don't hesitate to reach out with any updates on the issue.

Where / how do I change the config when using the docker image? So I build with CI/CD and can't change the source.

adrienbrignon commented 2 months ago

Hello @PhilStollery50Hertz, You should be able to increase the timeout (which defaults to 60000 milliseconds) by using the formats.pdf.browser.timeout option. Don't hesitate to reach out with any updates on the issue.

Where / how do I change the config when using the docker image? So I build with CI/CD and can't change the source.

You can change the configuration by editing the mkdocs.yml file directly from your repository.

PhilStollery commented 2 months ago

I tried to add one:

WARNING -  Config value 'plugins': Plugin 'exporter' option 'formats': Sub-option 'pdf': Sub-option 'timeout': Unrecognised
           configuration name: timeout

My config:

plugins:
  - exporter:
      logging:
        level: debug
      timeout: 120000
      formats:
        pdf:
          enabled: true
          explicit: true
          concurrency: 16
          stylesheets:
            - docs/stylesheets/pdf.scss
          aggregator:
            enabled: false
            output: reference_architecture.pdf
            covers: all
      buttons:
        - title: Download as PDF
          icon: material-file-download-outline
          enabled: !!python/name:mkdocs_exporter.formats.pdf.buttons.download.enabled
          attributes: !!python/name:mkdocs_exporter.formats.pdf.buttons.download.attributes
adrienbrignon commented 2 months ago

Here's an updated version of your configuration that should work:

plugins:
  - exporter:
      logging:
        level: debug
      formats:
        pdf:
          enabled: true
          explicit: true
          concurrency: 16
          browser:
            timeout: 120000
          stylesheets:
            - docs/stylesheets/pdf.scss
          aggregator:
            enabled: false
            output: reference_architecture.pdf
            covers: all
      buttons:
        - title: Download as PDF
          icon: material-file-download-outline
          enabled: !!python/name:mkdocs_exporter.formats.pdf.buttons.download.enabled
          attributes: !!python/name:mkdocs_exporter.formats.pdf.buttons.download.attributes

Don't hesitate to reach out with any updates on the issue.

PhilStollery commented 2 months ago

That fixed it - thanks.

adrienbrignon commented 2 months ago

Glad to hear!