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

Error in force(expr) : Failed to generate output in 30 seconds (timeout). #56

Open
jorgesinval opened this issue Jun 24, 2022 · 2 comments

Comments

@jorgesinval
Copy link

jorgesinval commented Jun 24, 2022

Hello!

I try to render a simple xaringan presentation:

---
title: "Example"
output: 
  xaringan::moon_reader:
    mathjax: "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_HTMLorMML"
---

# Introduction

with the this code:

renderthis::to_pdf(from = "example.Rmd",
                   to = "example.pdf")

but I keep receiving an error:

(¬_¬)renderthis::to_pdf(from = "example.Rmd",
...                    to = "example.pdf")
✔ Rendering example.Rmd into example.html ... done
✖ Rendering example.html into example.pdf ... failed
Error in force(expr) : Failed to generate output in 30 seconds (timeout).

However, if I remove:

    mathjax: "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_HTMLorMML"

it works:

(¬_¬)renderthis::to_pdf(from = "example.Rmd",
...                    to = "example.pdf")
✔ Rendering example.Rmd into example.html ... doneRendering example.html into example.pdf ... done
@gadenbuie
Copy link
Collaborator

gadenbuie commented Jun 24, 2022

There's an issue with that URL. Downloading it takes 15 seconds, opening it in a browser takes me about that long or longer. Maybe it's even slower in chromote?

system.time(
  download.file(
    "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_HTMLorMML",
    "mathjax.js"
  )
)
trying URL 'https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_HTMLorMML'
downloaded 61 KB

   user  system elapsed 
  0.046   0.046  15.933 

You can try running this and adjusting wait time to see if it eventually completes.

to_html("example.Rmd")
pagedown::chrome_print("example.html", "example.pdf", wait = 45)

@jorgesinval
Copy link
Author

Strangely, even after defining 120 seconds, I get:

(¬_¬)pagedown::chrome_print("example.html", "example.pdf", wait = 120)
Error in force(expr) : Failed to generate output in 30 seconds (timeout).

So, the error mentions 30 seconds.

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

2 participants