RStudio Connect: Interactive Markdown with Shiny. Error: path for html_dependency not provided

rstudioconnect

#1

I am trying to deploy a simple interactive Markdown/Shiny document on RStudio Connect. It is not a full-blown Shiny app, but a Markdown file with Shiny controls. When I deploy this document on RStudio Connect, the following error is thrown:

Error: path for html_dependency not provided

And the document fails to render. The local version runs just fine. Any ideas as to why this might be happening? Thanks.

Document code:

---
runtime: shiny
output: html_document
---
  
### Here are two Shiny widgets
  
```{r echo = FALSE}
require(shiny)
selectInput("n_breaks", label = "Number of bins:",
            choices = c(10, 20, 35, 50), selected = 20)

sliderInput("bw_adjust", label = "Bandwidth adjustment:",
            min = 0.2, max = 2, value = 1, step = 0.2)

...that build a histogram.

renderPlot({
  hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks),
       xlab = "Duration (minutes)", main = "Geyser eruption duration")
  
  dens <- density(faithful$eruptions, adjust = input$bw_adjust)
  lines(dens, col = "blue")
})

#2

Thanks for the note! As a commercial customer, I want to be sure you know that you always have access to support@rstudio.com and to an account representative who will be happy to route your request as well.

That said, this is also a good forum for discussion and assistance (and maybe help for others who run into the same issue). A few things:

  • What version of Connect are you running?
  • It would probably be helpful to have a bit more information behind the error message. The below article on troubleshooting deployments should be helpful! Is this error in the logs in the server UI? In the deployment log? You can increase the verbosity of the deployment log by:

going to Tools -> Global Options -> Publishing and selecting "Show diagnostic information when publishing".

  • The app deployed fine for me, so it does not seem that this is a Connect issue.
  • Generally, it is better to use library() than require(), in most cases. Some discussion here and here if interested. I began my R coding by using require exclusively and now have switched to library for the most part.

I'm curious to see a bit more detail on the logging. This error looks like it comes up when a shiny document is hit with rmarkdown::render() instead of rmarkdown::run(), but that shouldn't be an issue b/c Connect is taking care of that.

EDIT: One last golden nugget. If all you need are inputs, you can use parameterized rmarkdown to get a really nice deployment on Connect without injecting the shiny runtime! Info on parameterized Rmd.

This takes a little bit more time than the "responsive" rendering, but you get the added benefit of history tracking, email delivery, etc.

Always good to know that this is an option :slight_smile: The code is below as a rough sketch:



---
title: "Untitled"
author: "Cole Arendt"
date: "4/16/2018"
output: html_document
params:
  bins: 
    label: "Number of bins:"
    value: 20
    input: slider
    min: 10
    max: 50
    step: 10
  bw_adjust:
    label: "Bandwidth adjustment:"
    value: 1
    input: slider
    min: 0.2
    max: 2
    step: 0.2
    
---

 
```{r echo = TRUE}
require(shiny)
n_breaks <- params$bins

bw_adjust <- params$bw_adjust
```

```{r echo=TRUE}

  hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(n_breaks),
       xlab = "Duration (minutes)", main = "Geyser eruption duration")
  
  dens <- density(faithful$eruptions, adjust = bw_adjust)
  lines(dens, col = "blue")
```

#3

Hi Cole,

Thanks for a prompt response. We are currently evaluating RSConnect, which is why I thought starting with community support is best. I'm running:

RStudio Connect v1.6.0-9
Build "ddd9702"
Avaliable R Versions: 3.4.4
on Ubuntu.

I get the very same message in the deployment log (even without increasing verbosity) on my side

2018/04/16 14:43:09.528561256 $ echo: logi FALSE
2018/04/16 14:43:09.528647669
2018/04/16 14:43:09.721234174
2018/04/16 14:43:09.741092121 output file: /opt/rstudio-connect/mnt/tmp/RtmpBLb7gY/interactive_demo.knit.md
2018/04/16 14:43:09.741100727
2018/04/16 14:43:09.752604502 Error: path for html_dependency not provided
2018/04/16 14:43:09.753067932 Execution halted

and also on the server side when I look at the document log:

output file: /opt/rstudio-connect/mnt/tmp/RtmpBLb7gY/interactive_demo.knit.md
04/16 14:43:09.741
04/16 14:43:09.752
Error: path for html_dependency not provided
04/16 14:43:09.753
Execution halted

Is there any other information I would provide? I could also add you as user on the trial platform, if that'd help.

Kind regards,
Maxim

P.S. I'll look into parameterized Rmds. For the trial though, it is essential to evaluate the strengths and weaknesses of all kinds of context. We are very interested in interactive documents since these are the "golden middle way" in that they are less complex than regular Shiny apps yet not static as regular Markdown docs.


#4

That's helpful, Maxim, thanks! Is there anything else in your code? Or did you provide the whole file .Rmd file above?


#5

No, Cole, this is it.


#6

Maybe one more tidbit that would be helpful. Can you execute sessionInfo() or, preferably, devtools::session_info() to get a picture of what versions of packages you are using?


#7

Sure, here goes:

Session info ----------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.4 (2018-03-15)
 system   x86_64, mingw32             
 ui       RStudio (1.1.383)           
 language (EN)                        
 collate  English_United States.1252  
 tz       Europe/Paris                
 date     2018-04-18                  

Packages --------------------------------------------------------------------------------
 package    * version date       source        
 base       * 3.4.4   2018-03-15 local         
 compiler     3.4.4   2018-03-15 local         
 datasets   * 3.4.4   2018-03-15 local         
 devtools     1.13.5  2018-02-18 CRAN (R 3.4.3)
 digest       0.6.15  2018-01-28 CRAN (R 3.4.3)
 graphics   * 3.4.4   2018-03-15 local         
 grDevices  * 3.4.4   2018-03-15 local         
 htmltools    0.3.6   2017-04-28 CRAN (R 3.4.3)
 httpuv       1.3.6.2 2018-03-02 CRAN (R 3.4.3)
 memoise      1.1.0   2017-04-21 CRAN (R 3.4.4)
 methods    * 3.4.4   2018-03-15 local         
 mime         0.5     2016-07-07 CRAN (R 3.4.1)
 R6           2.2.2   2017-06-17 CRAN (R 3.4.3)
 Rcpp         0.12.16 2018-03-13 CRAN (R 3.4.4)
 rstudioapi   0.7     2017-09-07 CRAN (R 3.4.3)
 shiny      * 1.0.5   2017-08-23 CRAN (R 3.4.3)
 stats      * 3.4.4   2018-03-15 local         
 tools        3.4.4   2018-03-15 local         
 utils      * 3.4.4   2018-03-15 local         
 withr        2.1.2   2018-03-15 CRAN (R 3.4.4)
 xtable       1.8-2   2016-02-05 CRAN (R 3.4.3)
 yaml         2.1.18  2018-03-08 CRAN (R 3.4.4)

#8

Has there been any movement on this issue? I see quite a few people who aren't on the Rstudio Connect platform having this issue (timelyportfolio seems to have been talking to Joe Cheng about it already). Would be useful to know why this is happening, as it hasn't always been the case. All I have is a single selectInput, which causes the error

output file: app.knit.md

Error: path for html_dependency not provided
Execution halted

When I comment that out the empty flexdashboard loads no problem.

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2017.03

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] htmltools_0.3.6

loaded via a namespace (and not attached):
 [1] compiler_3.4.1      backports_1.1.2     magrittr_1.5        rprojroot_1.3-2     tools_3.4.1        
 [6] flexdashboard_0.5.1 yaml_2.1.19         Rcpp_0.12.17        stringi_1.2.2       rmarkdown_1.10     
[11] knitr_1.20          jsonlite_1.5        stringr_1.3.1       digest_0.6.15       evaluate_0.10.1