Skip to content

Cannot handle shinyWidgets::numericRangeInput #376

Description

@averissimo

AppDriver fails at initialization with shinyWidgets::numericRangeInput

Note that the sw.numericRange handler is registered on {shinyWidgets}' .onLoad()

How to reproduce

ui <- shiny::fluidPage(
  shiny::tags$br(),
  shinyWidgets::numericRangeInput(
    inputId = "my_id", label = "Numeric Range Input:",
    value = c(100, 400)
  ),
  shiny::verbatimTextOutput(outputId = "res1")
)

server <- function(input, output, session) {}

app <- shiny::shinyApp(ui, server) |> 
  shinytest2::AppDriver$new(variant = shinytest2::platform_variant())

app$get_logs()

or

app <- shinytest2::AppDriver$new(shinyWidgets::demoNumericRange())
#> Loading required package: shiny
app$get_logs()
#> {shinytest2} R  info   17:17:51.47 Start AppDriver initialization
#> {shinytest2} R  info   17:17:51.72 Starting Shiny app
#> {shinytest2} R  info   17:17:52.16 Creating new ChromoteSession
#> {shinytest2} R  info   17:17:52.96 Navigating to Shiny app
#> {shinytest2} R  info   17:17:53.04 Injecting shiny-tracer.js
#> {chromote}   JS info   17:17:53.06 shinytest2; jQuery not found
#> {chromote}   JS info   17:17:53.06 shinytest2; Loaded
#> {shinytest2} R  info   17:17:53.06 Waiting for Shiny to become ready
#> {chromote}   JS info   17:17:53.13 shinytest2; jQuery found
#> {chromote}   JS info   17:17:53.13 shinytest2; Waiting for shiny session to connect
#> {chromote}   JS info   17:17:53.19 shinytest2; Connected
#> {shinytest2} R  info   17:17:53.27 Waiting for Shiny to become idle for 200ms within 15000ms
#> {chromote}   JS info   17:17:53.27 shinytest2; Waiting for Shiny to be stable
#> {chromote}   JS info   17:17:53.47 shinytest2; Shiny has been idle for 200ms
#> {shinytest2} R  info   17:17:53.47 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:5134
#> {shiny}      R  stderr ----------- Warning: Error in <Anonymous>: No handler registered for type mpg:sw.numericRange
#> {shiny}      R  stderr -----------   14: <Anonymous> [/tmp/RtmpkziAl8/R.INSTALL620331194582/shiny/R/runapp.R#388]
#> {shiny}      R  stderr -----------   12: <Anonymous>
#> {shiny}      R  stderr -----------   11: <Anonymous>
#> {shiny}      R  stderr -----------   10: do.call
#> {shiny}      R  stderr -----------    9: saveRDS
#> {shiny}      R  stderr -----------    8: 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: tryCatch
#> {shiny}      R  stderr ----------- Error in (function (name, val, shinysession)  : 
#> {shiny}      R  stderr -----------   No handler registered for type mpg:sw.numericRange

Created on 2024-03-13 with reprex v2.0.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions