rstudio / shinydashboard

Shiny Dashboarding framework
https://rstudio.github.io/shinydashboard/
Other
885 stars 300 forks source link

Using renderMenu results in error 'could not find function "get_quosure"' #369

Closed ismirsehregal closed 2 years ago

ismirsehregal commented 2 years ago

When running the ?renderMenu example from shinydashboard:

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Dynamic sidebar"),
  dashboardSidebar(
    sidebarMenuOutput("menu")
  ),
  dashboardBody()
)

server <- function(input, output) {
  output$menu <- renderMenu({
    sidebarMenu(
      menuItem("Menu item", icon = icon("calendar"))
    )
  })
}

shinyApp(ui, server)

I get the following error:

Listening on http://127.0.0.1:4923
Warning: Error in get_quosure: could not find function "get_quosure"
  51: renderMenu
  50: server [~/.active-rstudio-document#16]
Error in get_quosure(expr, env, quoted) : 
  could not find function "get_quosure"

> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] shinydashboard_0.7.1 shiny_1.7.0         

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.1         xfun_0.26                bslib_0.3.0              shinyjs_2.0.0            purrr_0.3.4              colorspace_2.0-2        
 [7] vctrs_0.3.8              generics_0.1.0           htmltools_0.5.2          viridisLite_0.4.0        utf8_1.2.2               blob_1.2.2              
[13] plotly_4.9.4.1           rlang_0.4.11             jquerylib_0.1.4          later_1.3.0              pillar_1.6.3             glue_1.4.2              
[19] withr_2.4.2              DBI_1.1.1                bit64_4.0.5              lifecycle_1.0.1          munsell_0.5.0            gtable_0.3.0            
[25] fontawesome_0.2.2        htmlwidgets_1.5.4        evaluate_0.14            knitr_1.34               shinydashboardPlus_2.0.3 fastmap_1.1.0           
[31] httpuv_1.6.3             fansi_0.5.0              Rcpp_1.0.7               xtable_1.8-4             promises_1.2.0.1         scales_1.1.1            
[37] DT_0.19                  cachem_1.0.6             jsonlite_1.7.2           mime_0.11                fs_1.5.0                 bit_4.0.4               
[43] ggplot2_3.3.5            hms_1.1.1                digest_0.6.28            dplyr_1.0.7              RJSONIO_1.3-1.6          grid_4.1.1              
[49] tools_4.1.1              odbc_1.3.2               sass_0.4.0               magrittr_2.0.1           lazyeval_0.2.2           tibble_3.1.4            
[55] crayon_1.4.1             tidyr_1.1.3              pkgconfig_2.0.3          ellipsis_0.3.2           data.table_1.14.0        rstudioapi_0.13         
[61] rmarkdown_2.11           httr_1.4.2               RPostgres_1.3.3          R6_2.5.1                 compiler_4.1.1          
DivadNojnarg commented 2 years ago

Coming from here: https://github.com/rstudio/shinydashboard/blob/dc1e15b39b7198286373643e8e4417867548c467/R/menuOutput.R#L144 And maybe here: https://github.com/rstudio/shinydashboard/blob/dc1e15b39b7198286373643e8e4417867548c467/R/tabs.R#L83

WayneGitShell commented 2 years ago

Same issue for me. Have raised issue on https://github.com/rstudio/shiny/issues/3514 - will close now as reported correctly here.

wch commented 2 years ago

As a workaround, can you try installing shinydashboard from source?

install.packages("shinydashboard", type="source")
WayneGitShell commented 2 years ago

As a workaround, can you try installing shinydashboard from source?

install.packages("shinydashboard", type="source")

Tried it but didnt solve issue..

wch commented 2 years ago

Just to be clear, in order for the workaround to work, you must have shiny 1.7.0 installed, and then install shinydashboard from source -- shinydashboard must be built against shiny 1.7.0. So something like this (in a clean R session) should ensure that it's built that way:

install.packages("shiny")
install.packages("shinydashboard", type="source")

Note that I was able to reproduce the bug, and then after installing the packages using the code above, the app worked.

WayneGitShell commented 2 years ago
install.packages("shiny")
install.packages("shinydashboard", type="source")

Still doesnt fix the issue...

wch commented 2 years ago

Update: the new version of shinydashboard (0.7.2) is on CRAN, although at the moment only the source package is available; it will take some time for them to build the binary packages for various platforms. https://cran.r-project.org/web/packages/shinydashboard/

For now, you can install the source package with:

install.packages('shinydashboard', type='source')