Skip to content

Basic example fails and no valid themes are recognized on Windows #23

@aminadibi

Description

@aminadibi

I am recently having trouble running shiny apps with any themes on Windows 10 and 11 using R version 4.1.2 and RStudio 2022.02.0 Build 443.

Here's the most basic reproducible example:

library(shiny)
library(shinythemes)

# Define UI for application that draws a histogram
ui <- fluidPage(theme = shinytheme("united"),

    # Application title
    titlePanel("Old Faithful Geyser Data"),

    # Sidebar with a slider input for number of bins
    sidebarLayout(
        sidebarPanel(
            sliderInput("bins",
                        "Number of bins:",
                        min = 1,
                        max = 50,
                        value = 30)
        ),

        # Show a plot of the generated distribution
        mainPanel(
           plotOutput("distPlot")
        )
    )
)

server <- function(input, output) {

    output$distPlot <- renderPlot({
        # generate bins based on input$bins from ui.R
        x    <- faithful[, 2]
        bins <- seq(min(x), max(x), length.out = input$bins + 1)

        # draw the histogram with the specified number of bins
        hist(x, breaks = bins, col = 'darkgray', border = 'white')
    })
}

shinyApp(ui = ui, server = server)

It doesn't work with any themes and gives me this error:

> runApp()
 Error in shinytheme("united") : united is not an available theme. Valid themes are: .

I have tried this on different machines with different operating systems. I have this issue in Windows 10 and 11, but not in Mac or Ubuntu. On Windows 10, manually deleting and reinstalling the package did not help.

Here's session info:

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] shinythemes_1.2.0 shiny_1.7.1      

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8       withr_2.5.0      digest_0.6.29    later_1.3.0     
 [5] mime_0.12        R6_2.5.1         lifecycle_1.0.1  xtable_1.8-4    
 [9] magrittr_2.0.2   rlang_1.0.1      cli_3.2.0        promises_1.2.0.1
[13] ellipsis_0.3.2   tools_4.1.2      httpuv_1.6.5     fastmap_1.1.0   
[17] compiler_4.1.2   htmltools_0.5.2 

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