When using the preview button in Positron or quarto render command in Terminal in Positron, I keep receiving an error with a ShinyLive app for a website .qmd.
The errors are long so posting the first part:
Blockquote
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'components')
if (quartoArgsParsed.components === void 0) {
^
at parseCodeBlock (file:///home/username/.cache/shinylive/shinylive-0.9.1/scripts/codeblock-to-json.js:2681:24)
at file:///home/username/.cache/shinylive/shinylive-0.9.1/scripts/codeblock-to-json.js:2796:15
at eventLoopTick (ext:core/01_core.js:175:7)
Blockquote
This is followed by a bunch of .lua errors
I can 1) render the website locally without any shinylive .qmds in Positron, 2) run the code cell & then interact with the shinylive app in the Positron viewer 3) have tried using data from a local directory-same as the project, from a github raw url, & here in the example, directly inside the code cell for the shinylive app. I've also tried a bit of playing around with the #| options for Shinylive as well as engine and filters syntax in the YAML. I've tried deleting .quarto, _site, and clearing the whole shinylive .cache. The process stops when creating the temporary files of this .qmd qmdnamefiles, these are visible in Positron explorer. When clicking on that, there is only 'mediabag' subdirectory and no contents underneath.
QMD sample
```yaml --- title: "Test Dashboard" format: html engine: shiny filters: - shinylive --- ```
#| standalone: true
library(shiny)
# Data prep
df <- structure(
list(
variable = c("All", "Race", "Race", "Latina/o/x", "Latina/o/x", "Sex", "Sex",
"All", "Race", "Race", "Latina/o/x", "Latina/o/x", "Sex", "Sex"),
value = c("all", "Non-White or Multi-racial", "White only", "Yes", "No", "Male", "Female",
"all", "Non-White or Multi-racial", "White only", "Yes", "No", "Male", "Female"),
Number = c(4555, 1947, 1467, 1091, 551, 2050, 1710, 1734, 143, 561, 844, 603, 1016, 527),
Percent = c(45.6, 28, 48.2, 15.3, 15.9, 25.1, 92.8, 17.3, 8.2, 6.8, 50.5, 7.2, 11.4, 48.8),
sample_total = c(10000, 6954, 3046, 7125, 3464, 8157, 1843, 10000, 1745, 8255, 1672, 8328, 8920, 1080),
cohort = c("A", "A", "A", "A", "A", "A", "A",
"B", "B", "B", "B", "B", "B", "B")
),
row.names = c(NA, -14L),
class = "data.frame"
)
#CSV converstion requires factored cohort
cohort_lvls <- c('A', 'B')
df$cohort <- factor(dat$cohort, levels=cohort_lvls)
# UI
ui <- fluidPage(
titlePanel("Estimated Numbers by Cohort"),
sidebarLayout(
sidebarPanel(
selectInput("variable", "Select Variable:", choices = unique(df$variable))
),
mainPanel(
plotlyOutput("plot")
)
)
)
# Server
server <- function(input, output, session) {
output$plot <- renderPlotly({
dat <- df %>%
filter(variable == input$variable)
p <- dat %>%
ggplot(aes(cohort, Number, label2 = Number, label3 = sample_total)) +
geom_col(aes(fill = value), position = position_dodge(0.9), color = 'black') +
scale_fill_manual(values = c("#008995", "#D24310", "#32006E", "#FFC700", "#2C6ACE", "#925088", "#566069")) +
labs(x = NULL, y = 'Percentage', fill = input$variable)
ggplotly(p)
})
}
shinyApp(ui, server)
System and software info:
R version 4.5.1 (2025-06-13)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0 LAPACK version 3.12.0
Positron Version: 2025.07.0 build 204
Code - OSS Version: 1.100.3
Commit: 03ae7a5393c776bb24c23d2aa6a6bfbba90cbc5e
Date: 2025-06-30T16:31:43.163Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Linux x64 6.14.0-28-generic
Quarto 1.7.2
Shinylive 0.9.1