insightsengineering / insightsengineering/teal
[Bug]: Report export returns an error when using teal as a shiny module
- Dominant language
- R
- Stars
- 263
- Forks
- 59
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 5
Description
### What happened?
When I embed modules from `teal.modules.general` in a shiny app using teal framework as shiny module download report throws an error.

Here is a minimal example:
```
library(shiny)
library(random.cdisc.data)
library(teal.modules.general)
modules <- modules(
tm_g_bivariate(
x = data_extract_spec(
dataname = "ADSL",
select = select_spec(
label = "Select variable:",
choices = variable_choices("ADSL"),
selected = "AGE",
fixed = FALSE
)
),
y = data_extract_spec(
dataname = "ADSL",
select = select_spec(
label = "Select variable:",
choices = variable_choices("ADSL"),
selected = "SEX",
multiple = FALSE,
fixed = FALSE
)
)
)
)
ui <- fluidPage(
titlePanel("{teal} as shiny module: teal.modules.general"),
ui_teal(id = "teal", modules = modules)
)
server <- function(input, output) {
data <- reactive({
teal_data(
ADSL = random.cdisc.data::radsl(seed = 1)
)
})
srv_teal(id = "teal", data = data, modules = modules)
}
shinyApp(ui = ui, server = server)
```
### How to reproduce
1. Initial app
2. Add View to report
3. Navigate to report previewer
4. Click download report (see screenshot above)
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct.
### Contribution Guidelines
- [x] I agree to follow this project's Contribution Guidelines.
### Security Policy
- [x] I agree to follow this project's Security Policy.
Contributor guide
Assessment
This issue has not been assessed yet.