RStudio Connect No Longer Rendering Javascript

I am experiencing issues with RStudio Connect properly displaying output from DT, primarily tables and plots that are rendered through Bootstrap. It seems like the issue is related to not being able to find jQuery, which results in Bootstrap not being loaded.

Here's a very simple example of an RMarkdown file I am publishing from RStudio Server Pro:

---
title: "Untitled"
author: "Daren Eiri"
date: "6/2/2021"
output: html_document
---
## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
summary(cars)
## Including Plots

You can also embed plots, for example:

```{r}
plot(pressure)

library(magrittr)
library(DT)

summary(cars) %>% 
  datatable()

When I preview this by knitting in RStudio Server Pro, I can see the table:

But once I push-to-publish, the table is missing and I see errors regarding Bootstrap not loading:

Surprisingly, this has affected some other static content I have published a month or so ago. I have tried using R 3.6.2 and R 4.0.3 and updated rsconnect, packrat, DT without success. Maybe I'm missing something simple, or maybe it's related to how our IT manages our RStudio Connect resources (it's behind a proxy). However, I do see one document published months ago (as static content) that still displays the plots and tables from DT.

One thing I noticed in the browser inspector debugging tool, is that the <script src is a bit different:

Compared to when it is working (displaying the javascript content):

Any help is greatly appreciated.

Thanks so much for reaching out here! Can you take a look at the Network tab in your devtools? I suspect we will see a 404 error in the network tab somewhere when the browser reaches out to pick up the JavaScript libraries. How that URL is constructed could tell us some things / provide some hints :grinning_face_with_smiling_eyes:

Also it's worth noting that sometimes the browser devtools can have sensitive values! If you are concerned about how much of this it is possible to safely share publicly, it might make sense to reach out to support@rstudio.com! We can iterate there with better privacy, and then come back here with the resolution!

If you do reach out there, please copy / include this link so they can pull me in! :smiley: My suspicion is definitely proxy related - is your Connect server hosted at a subpath (i.e. like our demo server at https://colorado.rstudio.com/rsc/)?

Hi Cole!

Here's a screenshot of the Network tab.

Regarding the RSconnect server, yes it is hosted at a subpath which you can see in the screenshot. It's behind O365 authentication and Cloudflare.

Woops! Sorry for the delay here!

Thanks for sharing that - are there any other Network requests? Any that are "red" with "404" responses? Usually there are a bunch more. In any case, I don't see JQuery there, so I am hopeful it is showing up elsewhere :slight_smile: (As an example, here is my server loading jquery)

Another possibility is that there is something funky going on with your browser. Does this work in a "Private Browsing" window, or for other users? Or is behavior the same for everyone / in all browsers?

Thanks @cole for replying back!

I've tried this in other browsers, in different locations (office, home) and with other users. The result is the same where the data tables and other javascript visuals are not loading for newly published documents. Definitely a head-scratcher.

Here's the results from Chrome debugger. No 404 responses:

Strange! It still doesn't look like jquery is in there though. Do you see anything for jquery in your log? It almost looks like it's not even trying to load jquery. Can you share your manifest.json file associated with the app? (i.e. rsconnect::writeManifest())? Are you familiar with the rmarkdown "self-contained" header ? I'm wondering if creating a self-contained Rmd might resolve the problem as a workaround, at least.

@cole

Interesting.. Before, my Rmarkdown document was set to its default settings:

output: html_document

I changed it to

output:
    html_document:
        self_contained: false

And it produces the datatable I was expecting to see.

When it's set to self-contained: true then I don't see the datatable:

output:
    html_document:
        self_contained: true

Also, I'm using push-to-publish. The link below is a modified manifest.json (edited the url)