insightsengineering / insightsengineering/teal

[Bug]: Report export returns an error when using teal as a shiny module

Open
#1,513 6 comments 0 reactions 0 assignees View on GitHub
bug core
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.

![Image](https://github.com/user-attachments/assets/6c2a8b84-8237-4eda-acac-33f2e6af30c3)

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.