'object 'datatables_html' not found, while it works fine in a separate Shiny application

I'm making a Shiny application where a user can upload a file to do some analyses. In this part the user can choose some variables to use in a trend analysis. In a separate shiny application, the ggplot works fine, but here I got the error: object 'datatables_html' not found, while the object is not even used. What can be the problem? Sometimes I can visualize one variable, but when I pick another one, the Shiny application closes and gives me the error: object 'datatables_html' not found.

The problem is in the following code:

output$picker2 <- renderUI({
    pickerInput(inputId = 'pick2', 
                label = 'Choose which variables to use in the trend analysis', 
                choices = colnames(store$df), 
                options = list(`actions-box` = TRUE, `size` = 10),
                multiple = TRUE,
                selected = colnames(store$df))
})

 observeEvent(input$Var, {
    updateCheckboxGroupInput(session, "Variables", choices = input$pick2 ,
                      selected = NULL)})

observeEvent(input$Variables, {
  store$df <- store$df %>%
  pivot_longer(cols = input$Variables, names_to = "Symptoms", values_to = "Scores")
  output$weeks <- renderPlot({
  req(store$df)
    store$df %>% 
    filter(Symptoms == input$Variables) %>% 
    ggplot(aes(x = date_ymd_hms, y = Scores,
                          colour = fct_reorder2(Symptoms, date_ymd_hms, Scores))) +
  geom_smooth(se = FALSE, span = 0.5, method = "loess", na.rm = TRUE) +
  scale_y_continuous(limits = c(0, 100)) +
  scale_colour_brewer(palette = "Paired") +
  labs(x = "Date", y = "Score", colour = NULL) +
  theme_minimal() +
  theme(panel.grid.minor = element_blank(),
        panel.grid.major.x = element_blank(),
        legend.position = "right",
        text = element_text(size = 10)) +
 scale_x_datetime(breaks = date_breaks("1 day"), 
                   labels = date_format("%b %d"), 
                   expand = c(0,0),
                   limits = as.POSIXct(strptime(c("2022-03-10 06:57:18","2022-03-22 22:18:18"), format = "%Y-%m-%d %H:%M:%S")))
  })
  })


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source