Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Handle NULL return from bslib::theme_version #1090

Closed
2 of 3 tasks
slodge-work opened this issue Sep 29, 2023 · 4 comments
Closed
2 of 3 tasks

Handle NULL return from bslib::theme_version #1090

slodge-work opened this issue Sep 29, 2023 · 4 comments
Assignees
Labels

Comments

@slodge-work
Copy link

I'm currently upgrading a flexdashboard Rmd shiny app:

  • from R4.1 to R4.3
  • from DT from 0.23 to 0.29
  • from bslib 0.4 t o 0.5.1
  • ...among lots of other changes

We're hitting a problem at runtime in DT::datatable - Error in if (bs_v > 5) bs_v = 5 : argument is of length zero which it seems is just after this line:

bs_v = as.numeric(bslib::theme_version(theme)[1])

Looking at what is returned:

Browse[2]> bslib::bs_current_theme()
[1] "flatly"
Browse[2]> bslib::theme_version(bslib::bs_current_theme())
NULL

I think we'll be able to fix this problem locally... but thought I'd log this here - as it might be good to handle this defensively - e.g. adding:

  if (is.null(bs_v)) {
    return('default')
  }

Disclaimer: I don't have a small simple repro for this yet... so I'm afraid I can't tick all the boxes here... sorry!

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('DT'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/DT').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@slodge-work
Copy link
Author

Seen this again in another Rmd Shiny app... seems like it's definitely an issue between 0.28 and 0.29

@yihui yihui added the bug label Oct 3, 2023
@yihui yihui self-assigned this Oct 3, 2023
@yihui yihui closed this as completed in faba4fb Oct 3, 2023
@yihui
Copy link
Member

yihui commented Oct 3, 2023

Should be fixed now. Thanks for the report!

You can install the development version via

remotes::install_github('rstudio/DT')

@slodge-work
Copy link
Author

Thanks

Sorry I never got an issue repro to you 👍

@yihui
Copy link
Member

yihui commented Oct 3, 2023

I don't need a repro in this case. The bug was too obvious, and you have essentially sent the fix directly to me, which is even better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants