Dynamically render module ui from the server

Hi guys,

I am facing a similar problem as the one mentioned here, but I didn't find the solution there.
I have gone through a couple of posts in the community (this is one), but didn't find what I was looking for.

So the problem is, I'm trying to render the esquisseUI from the esquisse package dynamically from the server.

Here is a simple version of my app that's not working.

library(shiny)
library(esquisse)

ui = fluidPage(
  uiOutput("esquisse")
  ## this works
  #esquisserUI("input") 
)

server = function(input, output){
  data = reactiveValues(data = mtcars, name = "mtcars")
  output$esquisse = renderUI({
    esquisserUI("input")
  })
  callModule(esquisserServer, id = "input", data = data)
}
shinyApp(ui, server)

The error returned is Warning: Error in if: argument is of length zero [No stack trace available]

I think the esquisseUI is not getting rendered.

Looking forward to getting a solution from you guys. Thanks in advance.
Best regards,
Zauad Shahreer

I would recommend that you raise an issue about this on the esquisse github that you linked to.

Thanks. I may just do that.
But I think this is more of a design issue, something to do with the way the UI is rendered.

On a second thought, I have just tried the same mechanism with another module, and it worked.
I think you may be right, it is specific to the esquisseUI only.
Nonetheless, I'd appreciate it if someone can direct me towards the right direction here.