You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me that the shiny session does not respect the searchpath of the parent R session and throws the "object not found" type of errors for object that are findable in the standard workflow
Minimal reprex:
library(teal.modules.clinical)
#> Loading required package: teal#> Loading required package: shiny#> Loading required package: teal.data#> Loading required package: teal.code#> Loading required package: teal.slice#> Registered S3 method overwritten by 'teal':#> method from #> c.teal_slices teal.slice#> #> You are using teal version 0.15.2.9016#> #> Attaching package: 'teal'#> The following objects are masked from 'package:teal.slice':#> #> as.teal_slices, teal_slices#> Loading required package: teal.transform#> Loading required package: tern#> Loading required package: rtables#> Loading required package: formatters#> Loading required package: magrittr#> #> Attaching package: 'rtables'#> The following object is masked from 'package:utils':#> #> str#> Registered S3 method overwritten by 'tern':#> method from #> tidy.glm broom
library(shiny)
ui<- fluidPage(
titlePanel("Simple Shiny App"),
sidebarLayout(
sidebarPanel(
sliderInput("num_points", "Number of Points", min=10, max=100, value=50)
),
mainPanel(
plotOutput("scatter_plot")
)
)
)
server<-function(input, output) {
print(search())
print(obj_label)
output$scatter_plot<- renderPlot({
x<- rnorm(input$num_points)
y<- rnorm(input$num_points)
plot(x, y, main="Scatter Plot", xlab="X", ylab="Y")
})
}
app<- shinyApp(ui, server)
app_driver<-shinytest2::AppDriver$new(app)
app_driver$get_logs()
#> {shinytest2} R info 17:43:47.75 Start AppDriver initialization#> {shinytest2} R info 17:43:47.78 Starting Shiny app#> {shinytest2} R info 17:43:48.44 Creating new ChromoteSession#> {shinytest2} R info 17:43:49.03 Navigating to Shiny app#> {shinytest2} R info 17:43:49.05 Injecting shiny-tracer.js#> {chromote} JS info 17:43:49.06 shinytest2; jQuery found#> {chromote} JS info 17:43:49.07 shinytest2; Waiting for shiny session to connect#> {chromote} JS info 17:43:49.07 shinytest2; Loaded#> {shinytest2} R info 17:43:49.07 Waiting for Shiny to become ready#> {chromote} JS info 17:43:49.12 shinytest2; Connected#> {shinytest2} R info 17:43:49.19 Waiting for Shiny to become idle for 200ms within 15000ms#> {chromote} JS info 17:43:49.19 shinytest2; Waiting for Shiny to be stable#> {chromote} JS info 17:43:49.40 shinytest2; Shiny has been idle for 200ms#> {shinytest2} R info 17:43:49.40 Shiny app started#> {shiny} R stderr ----------- Loading required package: shiny#> {shiny} R stderr ----------- Running application in test mode.#> {shiny} R stderr ----------- #> {shiny} R stderr ----------- Listening on http://127.0.0.1:7424#> {shiny} R stderr ----------- Warning: Error in server: object 'obj_label' not found#> {shiny} R stderr ----------- 52: print#> {shiny} R stderr ----------- 51: server [<text>#17]#> {shiny} R stderr ----------- 14: <Anonymous>#> {shiny} R stderr ----------- 12: <Anonymous>#> {shiny} R stderr ----------- 11: <Anonymous>#> {shiny} R stderr ----------- 10: base::do.call#> {shiny} R stderr ----------- 9: base::saveRDS#> {shiny} R stderr ----------- 8: base::withCallingHandlers#> {shiny} R stderr ----------- 7: doTryCatch#> {shiny} R stderr ----------- 6: tryCatchOne#> {shiny} R stderr ----------- 5: tryCatchList#> {shiny} R stderr ----------- 2: tryCatchList#> {shiny} R stderr ----------- 1: base::tryCatch#> {shiny} R stderr ----------- Error in server(...) : object 'obj_label' not found#> {shiny} R stdout ----------- [1] ".GlobalEnv" "package:shiny" "package:stats" #> {shiny} R stdout ----------- [4] "package:graphics" "package:grDevices" "package:utils" #> {shiny} R stdout ----------- [7] "package:datasets" "package:methods" "Autoloads" #> {shiny} R stdout ----------- [10] "tools:callr" "package:base"app_driver$stop()
It seems to me that the shiny session does not respect the searchpath of the parent R session and throws the "object not found" type of errors for object that are findable in the standard workflow
Minimal reprex:
Created on 2024-04-02 with reprex v2.1.0
This object should be available through the chain of Depends:
Created on 2024-04-02 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: