Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Shiny accordion in bookmark page #659

Closed
riskcede opened this issue Jul 6, 2023 · 3 comments
Closed

Shiny accordion in bookmark page #659

riskcede opened this issue Jul 6, 2023 · 3 comments

Comments

@riskcede
Copy link

riskcede commented Jul 6, 2023

Error when using accordions in UI when UI is wrapped in a function

I want to use the bslib accordion in my UI. It works fine in a basic app.

But I bookmark my app, so instead of just using UI <- fluidpage i use UI <- function(request) {}

As soon as i do this i get an error saying 'Invalid first argument'.

Im not able to debug this to get an idea of what the actual error is.

Can you please advise.

I get the following error:

Listening on http://127.0.0.1:3764
Warning: Error in exists: invalid first argument
89: exists
88: self$exists
87: oldInputs$available
86: shiny::restoreInput
85: bslib::accordion
69: ui [#3]
3: runApp
2: print.shiny.appobj
1:

library(shiny)
library(bslib)

ui <- function(request) {
# ui <-
  page_navbar(
    accordion(accordion_panel('Category 2'))
  )
}


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

shinyApp(ui, server, enableBookmarking = "url")

Session Info


R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
[1] LC_CTYPE=en_ZA.UTF-8 LC_NUMERIC=C LC_TIME=en_ZA.UTF-8 LC_COLLATE=en_ZA.UTF-8 LC_MONETARY=en_ZA.UTF-8
[6] LC_MESSAGES=en_ZA.UTF-8 LC_PAPER=en_ZA.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_ZA.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] bslib_0.5.0 shiny_1.7.4

loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 digest_0.6.28 later_1.3.0 mime_0.12 R6_2.5.1 lifecycle_1.0.3 xtable_1.8-4 jsonlite_1.7.2 magrittr_2.0.3
[10] rlang_1.1.0 cachem_1.0.6 cli_3.4.1 promises_1.2.0.1 rstudioapi_0.13 jquerylib_0.1.4 ellipsis_0.3.2 tools_4.1.2 httpuv_1.6.3
[19] fastmap_1.1.0 compiler_4.1.2 htmltools_0.5.4 sass_0.4.4

@gadenbuie
Copy link
Member

Hi @riskcede, I believe this was recently fixed in #646. Can you try installing the development version of bslib?

devtools::install_github("rstudio/bslib")

@riskcede
Copy link
Author

riskcede commented Jul 10, 2023 via email

@github-actions
Copy link

This issue has been automatically locked. If you have found a related problem, please open a new issue (with a reproducible example or feature request) and link to this issue.
🙋 Need help? Connect with us on Discord or Posit Community.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants