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

Time out error #43

Open
albert-ying opened this issue Dec 10, 2021 · 6 comments
Open

Time out error #43

albert-ying opened this issue Dec 10, 2021 · 6 comments

Comments

@albert-ying
Copy link

Hi, when building to pdf from HTML, I got these errors

xaringanBuilder::build_pdf('xxx.html', complex_slides = T, partial_slides = T)
Error: Chromote: timed out waiting for response to command Target.createTarget

And sometimes

Error: Chromote: timed out waiting for event Page.loadEventFired

I'm wondering what may cause this and how may I prevent it?

Thank you!

@albert-ying
Copy link
Author

I just tested. Same code works fine for a smaller HTML slides. Maybe it is due to the slide is too big and took a while to process, which is longer than the timed out limit and been killed? If so how do I adjust for the timed out limit?

@jhelvy
Copy link
Owner

jhelvy commented Dec 14, 2021

Interesting problem, I haven't run into this before. Is there an html slide deck that you could link to so we could try and reproduce this error?

@albert-ying
Copy link
Author

Not sure whether it is related, but I adjusted the size of some figures in the slides, now I don't see the error. I just opened a new issue #44 which might related to this

@gadenbuie
Copy link
Collaborator

The image size is likely the root cause of the problem -- I'd be interested to hear how large the image was before you reduced the size.

This does bring up that both pagedown::chrome_print() and chromote allow us to configure the timeout when waiting for the page load and we could expose this cleanly in build_pdf().

We'd add the wait arg to chrome_print() here (the default is 2) https://github.com/jhelvy/xaringanBuilder/blob/235c8c41d9e720fa48171fa8567839d2e042660d/R/pdf.R#L99-L102

And <ChromoteSession>$Page$loadEventFired() has a timeout_ argument (not sure what the specific default value is there), which we'd want to set here https://github.com/jhelvy/xaringanBuilder/blob/235c8c41d9e720fa48171fa8567839d2e042660d/R/pdf.R#L123-L124

@albert-ying
Copy link
Author

I used to have ~30 pictures, each ~ 5Mb. I also noticed that sometimes by setting self-contain: true, the timeout error could be avoided. Probably because it take a long time to load pictures. It would be nice to be able to set the timeout limit as an argument from build_* functions in the future! Thank you so much!

@gadenbuie
Copy link
Collaborator

Ah that makes sense. 150MB of images isn't gigantic but it is fairly large. Check out the issue and linked Twitter thread in #26, there are some tips there about reducing the image size without losing quality!

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

No branches or pull requests

3 participants