Shinyapp.io (Error in value[[3L]](cond) : plot.new has not been called yet)

Hi,

I'm getting a persistent error when I try to deploy a dashboard to shinyapps.io.

Error in value[3L] : plot.new has not been called yet

This is a modular dashboard which I've been building with the golem framework. It runs fine locally and all the package checks pass but it fails in shinyapps.io so I'm not sure how to begin to trouble shoot this error. To my knowledge I haven't called plot.new anywhere in the package.

ps. I've managed to isolated the issue in a reprex see below.
Thanks

@importFrom shinydashboard box

mod_hist_ui <- function(id){

  ns <- shiny::NS(id)

  shiny::tagList(
    shiny::fluidRow(
      box(shiny::plotOutput(ns("plot1"), height = 250)),

      box(
        title = "Controls",
        shiny::sliderInput(ns("slider"), "Number of observations:", 1, 500, 50)
      )
    )
  )
}

mod_hist_server <- function(id) {

  moduleServer(id,

               #' @importFrom ggplot2 ggplot aes geom_histogram theme_minimal theme element_rect geom_point labs theme_light element_blank element_text
               #' @importFrom stats rnorm
               #'
               function(input, output, session) {

                 # Server logic ---------------------------------------------------------

                 # List the first level callModules here
                 set.seed(122)
                 histdata <- rnorm(500)

                 output$plot1 <- renderPlot({

                   data <- histdata[seq_len(input$slider)]

                   ggplot2::ggplot()+
                     ggplot2::geom_histogram(ggplot2::aes(x = data))+
                     ggplot2::theme_light()

                 })

               })
}


demo_hist <- function() {
  ui <- shiny::fluidPage(mod_hist_ui("hist_1"))

  server <- function(input, output, session) {
    mod_hist_server("hist1")
  }
  shiny::shinyApp(ui, server)
}

demo_hist()
#> Error in box(shiny::plotOutput(ns("plot1"), height = 250)): plot.new has not been called yet

Created on 2020-09-29 by the reprex package (v0.3.0)

you need to decide if the instance of your module is called 'hist_1' or 'hist1', the names are required to match between the id for the UI and that for the server

Did you ever find a solution? I'm facing the same error and have not been able to figure it out.