JohnCoene / waiter

🕰️ Loading screens for Shiny
https://waiter.john-coene.com/
Other
495 stars 25 forks source link

JavaScript errors when autoWaiter() is called more than once in a page #139

Closed daattali closed 11 months ago

daattali commented 1 year ago

When autoWaiter() is called multiple times, the page has javascript errors Uncaught SyntaxError: Identifier 'auto' has already been declared. Example:

library(shiny)
ui <- fluidPage(
  waiter::autoWaiter(),
  waiter::autoWaiter()
)
server <- function(input, output, session) {}
shinyApp(ui, server)

This might be a silly example, but when building a real shiny app with multiple modules, it's possible for different modules that don't know about each other's dependencies to each make a call to autoWaiter().