Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ui_element must be a Shiny tag" error when using plotlyOutput and DTOutput #73

Closed
ilaria-kode opened this issue Aug 1, 2022 · 1 comment

Comments

@ilaria-kode
Copy link

Hi,

when using the latest version on github ( 26a6569 ) , I get this error

ui_element must be a Shiny tag

on apps that were working fine with previous versions of the package and that use plotly or DT packages.

A minimal reprex is this app:

library(shiny)
library(shinycssloaders)
library(plotly)

ui <- fluidPage(

    sidebarLayout(
        sidebarPanel(

        ),

        mainPanel(
           plotlyOutput("distPlot") %>% withSpinner()
        )
    )
)

server <- function(input, output) {

    output$distPlot <- renderPlotly({

      faithful %>%
        ggplot(aes(eruptions,waiting))+
        geom_point()
    })
}

# Run the application
shinyApp(ui = ui, server = server)

I believe the problem is caused by the fact that the withSpinner function is checking for inheritance on shiny.tag while both plotlyOutput and DTOutput return objects with class shiny.tag.list .

thank you,
Ilaria

@daattali
Copy link
Owner

daattali commented Aug 1, 2022

Thanks for reporting and for doing the extra work of finding the cause!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants