Skip to content

Time out error #43

Open
Open

Description

@albert-ying

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!

Activity

  1. albert-ying commented on Dec 10, 2021

    @albert-ying
    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?

  2. jhelvy commented on Dec 14, 2021

    @jhelvy
    Owner

    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?

  3. albert-ying commented on Dec 14, 2021

    @albert-ying
    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

  4. gadenbuie commented on Dec 14, 2021

    @gadenbuie
    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

  5. albert-ying commented on Dec 14, 2021

    @albert-ying
    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!

  6. gadenbuie commented on Dec 14, 2021

    @gadenbuie
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions