Skip to content

shinytest2 warnings when using shiny.destroy #6

@ashbaldry

Description

@ashbaldry

When running the unit tests for the package, the following warning appears several times:

Warning (test-submodule_app.R:46:3): Input within a sub-module cannot be accessed after module is destroyed
Failed to locate globals in server function.
i This may be due to non-standard evaluation or other dynamic code. The app may not work as expected.
Caused by error in `globalsByName()`:
! Identified global objects via static code inspection (new("standardGeneric", .Data = function (fun, envir = environment(fun),; value); standardGeneric("body<-"), generic = structure("body<-", package = "base"),; package = "base", group = list(), valueClass = character(0),; signature = c("fun", "envir", "value"), default = new("derivedDefaultMethod",; .Data = function (fun, envir = environment(fun), value); ...; .Data = "ANY", names = "fun", package = "methods"),; generic = structure("body<-", package = "base")))(fun,; envir, value))). Failed to locate global object in the relevant environments: 'fun'
Backtrace:
     ▆
  1. └─shinytest2::AppDriver$new(shinyApp(ui, server), name = "basic_app") at test-submodule_app.R:46:3
  2.   └─shinytest2 (local) initialize(...)
  3.     └─shinytest2:::app_initialize(...)
  4.       ├─base::withCallingHandlers(...)
  5.       └─shinytest2:::app_initialize_(self, private, ..., view = view)
  6.         └─shinytest2:::app_save(app_dir)
  7.           └─shinytest2:::app_data(app)
  8.             └─shinytest2:::app_server_globals(server)
  9.               └─base::tryCatch(...)
 10.                 └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 11.                   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 12.                     └─value[[3L]](cond)

Need to work out why this is happening when adding code server-side

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions