Not sure who is responsible so I create a similar issue in the bslib.
So bs_theme(version="3") should work the same as NULL for the theme argument in the shiny::fluidPage.
Unfortunately shinyWidgets::switchInput is crashing the shiny app when bs_theme(version="3") is used, and not when NULL is used.
minimal example:
library(shiny)
ui <- fluidPage(
theme = bslib::bs_theme(version = "3"), # when NULL it is ok
shinyWidgets::switchInput("sth", "sth")
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
Error message:
Listening on http://127.0.0.1:3630
Warning: Error in compile_data: Error: Undefined variable: "$secondary".
on line 69:16 of ../../../../Library/Frameworks/R.framework/Versions/4.2/Resources/library/shinyWidgets/assets/bootstrap-switch/bootstrap-switch-3.4/bootstrap-switch.scss
from line 11:9 of stdin
>> background: $secondary;
---------------^
3: runApp
2: print.shiny.appobj
1: <Anonymous>
sessionInfo:
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.5.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_1.7.2 ...
loaded via a namespace (and not attached):
[1] bslib_0.4.0 ...
[81] shinyWidgets_0.7.3
Not sure who is responsible so I create a similar issue in the bslib.
So bs_theme(version="3") should work the same as NULL for the theme argument in the shiny::fluidPage.
Unfortunately shinyWidgets::switchInput is crashing the shiny app when bs_theme(version="3") is used, and not when NULL is used.
minimal example:
Error message:
sessionInfo: