I want to load a data file for a shinylive-r without user input. My demo code works fine in a Shiny app, but not in shinylive-r.
Here is my Shiny app code:
library(shiny)
ui <- fluidPage(
tableOutput("data"),
)
server <- function(input, output, session) {
fileData <- reactiveFileReader(
intervalMillis = 1000, NULL,
filePath = 'https://github.com/petzi53/learning-shiny/raw/refs/heads/master/data/products.tsv',
readFunc = vroom::vroom, show_col_types = FALSE
)
output$data <- renderTable({
head(fileData())
})
}
shinyApp(ui, server)
#>
#> Listening on http://127.0.0.1:6881
Created on 2025-07-04 with reprex v2.1.1
I used a file URL because I believe that it is not possible to reference local files with shinylive.
And here is my shinylive-r code chunk:
---
title: "Test shinylive reactiveFileReader "
format: html
filters:
- shinylive
---
```{shinylive-r}
#| standalone: true
#| viewerHeight: 550
#| components: [editor, viewer]
## file apps.R
{{< include test-shinylive-reactive-file/app.R >}}
```
The result is a blank screen with the error message:
Error: cannot open the connection to 'https://github.com/petzi53/learning-shiny/raw/refs/heads/master/data/products.tsv'. See the Javascript console for further information
Any idea what is wrong? Help is very much appreciated.