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

Load timeout option #224

Open
lnalborczyk opened this issue Oct 23, 2020 · 3 comments
Open

Load timeout option #224

lnalborczyk opened this issue Oct 23, 2020 · 3 comments

Comments

@lnalborczyk
Copy link

lnalborczyk commented Oct 23, 2020

Hi,

thank you very much for creating and maintaining this package!

I am using it regularly to export my HTML5 slides (created using RStudio) into .pdf documents. This usually works fine, for instance I can export these slides (https://www.barelysignificant.com/IMSB2020/slides/Cours04) using the following command:

decktape generic https://www.barelysignificant.com/IMSB2020/slides/Cours04 Cours04.pdf

without problem.

However, when I try to export the following course (available online at https://www.barelysignificant.com/IMSB2020/slides/Cours05), the following command:

decktape generic https://www.barelysignificant.com/IMSB2020/slides/Cours05 Cours05.pdf

results in this error:

Loading page https://www.barelysignificant.com/IMSB2020/slides/Cours05 ...
TimeoutError: Navigation Timeout Exceeded: 20000ms exceeded
    at Promise.then (/usr/local/lib/node_modules/decktape/node_modules/puppeteer/lib/LifecycleWatcher.js:143:21)
  -- ASYNC --
    at Frame.<anonymous> (/usr/local/lib/node_modules/decktape/node_modules/puppeteer/lib/helper.js:108:27)
    at Page.waitForNavigation (/usr/local/lib/node_modules/decktape/node_modules/puppeteer/lib/Page.js:682:49)
    at Page.<anonymous> (/usr/local/lib/node_modules/decktape/node_modules/puppeteer/lib/helper.js:109:23)
    at /usr/local/lib/node_modules/decktape/decktape.js:219:21
    at process._tickCallback (internal/process/next_tick.js:68:7)

My guess is that this issue appears because this particular course contains interactive plots, created using the plotly package in R (https://plotly.com/r/), on slides 3 and 12...

Would you have any idea on how to solve this issue?

Best wishes,

Ladislas

@lnalborczyk lnalborczyk changed the title Export slides that contain interactive plots (plotly) Exporting slides that contain interactive plots (plotly) Oct 23, 2020
@astefanutti
Copy link
Owner

Thanks a lot for the kind feedback.

I've just tried exporting the presentation by increasing the following timeout and it works:

const load = page.waitForNavigation({ waitUntil: 'load', timeout: 20000 });

For some reasons, the presentation seems to take quite a lot of time to load. It defaults to 20s as it's long enough for presentations to load, and short enough to timeout and report when there is an issue.

A solution would be to add an option so that you can provide a longer timeout. Also, it may be worth analyse why this particular presentation takes more than 20s to load.

@lnalborczyk
Copy link
Author

lnalborczyk commented Oct 23, 2020

Thank you for your quick answer, it solved it!

My guess is that this specific presentation takes a long time to load because it contains several high resolution .svg figures, some interactive plots, and embedded external web pages (e.g., on slide 34).

@astefanutti
Copy link
Owner

Great! Yes it seems the presentation contain some large assets. It may be possible to have them lazy loaded. Anyway, I think it would be useful to have an option to override the default timeout.

@astefanutti astefanutti changed the title Exporting slides that contain interactive plots (plotly) Load timeout option Oct 26, 2020
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